summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorAliaksandr Kalenik <kalenik.aliaksandr@gmail.com>2023-05-02 17:20:10 +0300
committerAndreas Kling <kling@serenityos.org>2023-05-02 18:50:26 +0200
commitf6ff37398cba534314387cb889640ea90dec415f (patch)
tree94ad32b7bf9e7c3aa07ee9a23fdccb1959ee6170 /Tests
parent9bd35fda56b32f7aa022b94c3d228942ad3dff9b (diff)
downloadserenity-f6ff37398cba534314387cb889640ea90dec415f.zip
LibWeb: Fix intrinsic sizing when min or max width is specified
Fixes the problem that width is incorrectly computed in intrinsic sizing mode when there are blocks that have min-width or max-width specified. Actually that is just the fix of a symptom of the larger problem that Length::to_px() returns 0 when value is auto regardless of available size.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibWeb/Layout/expected/block-and-inline/intrinsic-sizing-with-min-width-specified.txt5
-rw-r--r--Tests/LibWeb/Layout/input/block-and-inline/intrinsic-sizing-with-min-width-specified.html17
2 files changed, 22 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/intrinsic-sizing-with-min-width-specified.txt b/Tests/LibWeb/Layout/expected/block-and-inline/intrinsic-sizing-with-min-width-specified.txt
new file mode 100644
index 0000000000..36aeea9e0f
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/block-and-inline/intrinsic-sizing-with-min-width-specified.txt
@@ -0,0 +1,5 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (1,1) content-size 798x52 children: not-inline
+ BlockContainer <body> at (10,10) content-size 104x34 floating children: not-inline
+ BlockContainer <div.outer> at (11,11) content-size 102x32 children: not-inline
+ BlockContainer <div.inner> at (12,12) content-size 100x30 children: not-inline
diff --git a/Tests/LibWeb/Layout/input/block-and-inline/intrinsic-sizing-with-min-width-specified.html b/Tests/LibWeb/Layout/input/block-and-inline/intrinsic-sizing-with-min-width-specified.html
new file mode 100644
index 0000000000..c0b5a635ca
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/block-and-inline/intrinsic-sizing-with-min-width-specified.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html><style>
+* {
+ font-family: 'SerenitySans';
+ border: 1px solid black;
+}
+body {
+ float: left;
+}
+.outer {
+ min-width: 32px;
+ background-color: orange;
+}
+.inner {
+ width: 100px;
+ height: 30px;
+}
+</style><div class="outer"><div class="inner"> \ No newline at end of file