summaryrefslogtreecommitdiff
path: root/Tests/LibWeb
diff options
context:
space:
mode:
authorAliaksandr Kalenik <kalenik.aliaksandr@gmail.com>2023-05-05 09:45:19 +0300
committerAndreas Kling <kling@serenityos.org>2023-05-05 10:01:28 +0200
commit34b11862728503bf523c792939219d93a6155351 (patch)
tree2e3fab77868b004dfac437a23f80e833dbbab4fb /Tests/LibWeb
parent2d2d2539b4caaeb4d796c421983ca6bf8a77bdde (diff)
downloadserenity-34b11862728503bf523c792939219d93a6155351.zip
LibWeb: Remove early resolve to auto while calculating border-box width
`Length::resolved(Node&)` transforms infinite values to "auto". Following transformations: Infinite (Length) -> "auto" -> 0 (px) cause border-box width to be resolved in zero when it should be inf px. Removing `Length::resolved(Node&)` makes it work right: Infinite (Length) -> Infinite (px) Fixes #18649
Diffstat (limited to 'Tests/LibWeb')
-rw-r--r--Tests/LibWeb/Layout/expected/block-and-inline/max-width-percentage-100-border-box.txt8
-rw-r--r--Tests/LibWeb/Layout/input/block-and-inline/max-width-percentage-100-border-box.html8
2 files changed, 16 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/max-width-percentage-100-border-box.txt b/Tests/LibWeb/Layout/expected/block-and-inline/max-width-percentage-100-border-box.txt
new file mode 100644
index 0000000000..0c6a27a5c9
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/block-and-inline/max-width-percentage-100-border-box.txt
@@ -0,0 +1,8 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (1,1) content-size 798x0 [BFC] children: not-inline
+ BlockContainer <body> at (10,10) content-size 93.59375x19.46875 positioned [BFC] children: not-inline
+ BlockContainer <nav> at (11,11) content-size 91.59375x17.46875 children: inline
+ line 0 width: 91.59375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 10, rect: [11,11 91.59375x17.46875]
+ "border box"
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/block-and-inline/max-width-percentage-100-border-box.html b/Tests/LibWeb/Layout/input/block-and-inline/max-width-percentage-100-border-box.html
new file mode 100644
index 0000000000..d74d8908b5
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/block-and-inline/max-width-percentage-100-border-box.html
@@ -0,0 +1,8 @@
+<!doctype html><style>
+* { border: 1px solid black; font-family: 'SerenitySans'; }
+body { position: absolute; }
+nav {
+ max-width: 100%;
+ box-sizing: border-box;
+}
+</style><body><nav>border box \ No newline at end of file