From 473848be0efed5a8e39a0aa58b1465a6fb3e9eb3 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 22 Jun 2023 18:02:04 +0300 Subject: [PATCH] LibWeb: Do not treat size of abspos items as definite This fixes the issue when size of abspos items is considered to be resolvable without performing layout which is not correct in the scenarious when top/right/bottom/left properties are not auto. --- .../abspos-box-with-replaced-element.txt | 7 ++++++ .../abspos-box-with-replaced-element.html | 22 ++++++++++++++++++ Tests/LibWeb/Layout/input/img.webp | Bin 0 -> 5664 bytes .../Libraries/LibWeb/Layout/LayoutState.cpp | 1 + 4 files changed, 30 insertions(+) create mode 100644 Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt create mode 100644 Tests/LibWeb/Layout/input/abspos-box-with-replaced-element.html create mode 100644 Tests/LibWeb/Layout/input/img.webp diff --git a/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt b/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt new file mode 100644 index 0000000000..56daa46912 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt @@ -0,0 +1,7 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (1,1) content-size 798x0 [BFC] children: not-inline + BlockContainer at (10,10) content-size 500x100 positioned [BFC] children: not-inline + BlockContainer at (261,11) content-size 248x28.4836 positioned [BFC] children: inline + line 0 width: 250, height: 28.4836, bottom: 28.4836, baseline: 28.4836 + frag 0 from ImageBox start: 0, length: 0, rect: [262,12 248x26.4836] + ImageBox at (262,12) content-size 248x26.4836 children: not-inline diff --git a/Tests/LibWeb/Layout/input/abspos-box-with-replaced-element.html b/Tests/LibWeb/Layout/input/abspos-box-with-replaced-element.html new file mode 100644 index 0000000000..77694c05b9 --- /dev/null +++ b/Tests/LibWeb/Layout/input/abspos-box-with-replaced-element.html @@ -0,0 +1,22 @@ +
\ No newline at end of file diff --git a/Tests/LibWeb/Layout/input/img.webp b/Tests/LibWeb/Layout/input/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