diff options
author | Andreas Kling <kling@serenityos.org> | 2023-03-18 00:24:51 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-18 00:26:19 +0100 |
commit | 1dc074fc18970915c08b0b9b5e07945c67bda7e4 (patch) | |
tree | 7bf7c0ec99da1a240f7a7dd16914861aba086793 /Tests/LibWeb/Layout | |
parent | 062b8e59575c056d87dd8f01fab8c7a41f63d9f0 (diff) | |
download | serenity-1dc074fc18970915c08b0b9b5e07945c67bda7e4.zip |
LibWeb: Treat flex item's cyclic percentage cross size as auto
This fixes an issue where e.g `height: 100%` on a flex item whose
container has indefinite height was being resolved to 0. It now
correctly behaves the same as auto.
Diffstat (limited to 'Tests/LibWeb/Layout')
-rw-r--r-- | Tests/LibWeb/Layout/expected/flex-item-with-cyclic-percentage-height.txt | 10 | ||||
-rw-r--r-- | Tests/LibWeb/Layout/input/flex-item-with-cyclic-percentage-height.html | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/flex-item-with-cyclic-percentage-height.txt b/Tests/LibWeb/Layout/expected/flex-item-with-cyclic-percentage-height.txt new file mode 100644 index 0000000000..56e5352b60 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/flex-item-with-cyclic-percentage-height.txt @@ -0,0 +1,10 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer <html> at (1,1) content-size 798x39.46875 children: not-inline + BlockContainer <body> at (10,10) content-size 780x21.46875 children: not-inline + Box <div.flexrow> at (11,11) content-size 778x19.46875 flex-container(row) children: not-inline + Box <div.project> at (12,12) content-size 44.03125x17.46875 flex-container(column) flex-item children: not-inline + BlockContainer <(anonymous)> at (12,12) content-size 44.03125x17.46875 flex-item children: inline + line 0 width: 44.03125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 6, rect: [12,12 44.03125x17.46875] + "pillow" + TextNode <#text> diff --git a/Tests/LibWeb/Layout/input/flex-item-with-cyclic-percentage-height.html b/Tests/LibWeb/Layout/input/flex-item-with-cyclic-percentage-height.html new file mode 100644 index 0000000000..44a0ecccf7 --- /dev/null +++ b/Tests/LibWeb/Layout/input/flex-item-with-cyclic-percentage-height.html @@ -0,0 +1,14 @@ +<!DOCTYPE html><html><head><style> + * { + border: 1px solid black; + font: 16px 'SerenitySans'; + } + .project { + display: flex; + flex-direction: column; + height: 100%; + } + .flexrow { + display: flex; + } +</style></head><body><div class="flexrow"><div class="project">pillow
\ No newline at end of file |