summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
author0GreenClover0 <clovers02123@gmail.com>2023-05-05 02:58:49 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-05 13:26:41 +0200
commit8bb2663a22fe4ef94168764cdd7f4199ff84d4b4 (patch)
treeac7bb84e2110662c5a0e92f9d2c85ada7f292e2c /Tests
parent0d808f6dcbc8af6fbea16a7783b154d5ede5c3fa (diff)
downloadserenity-8bb2663a22fe4ef94168764cdd7f4199ff84d4b4.zip
LibWeb: Zero out margins if width is not 'auto' in BFC's compute_width
Reverse the condition to satisfy the spec comment. Probably a typo. A 3 year old typo! :^)
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibWeb/Layout/expected/block-and-inline/width-auto-margins-set-zero-if-containing-size-smaller.txt15
-rw-r--r--Tests/LibWeb/Layout/input/block-and-inline/width-auto-margins-set-zero-if-containing-size-smaller.html6
2 files changed, 21 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/width-auto-margins-set-zero-if-containing-size-smaller.txt b/Tests/LibWeb/Layout/expected/block-and-inline/width-auto-margins-set-zero-if-containing-size-smaller.txt
new file mode 100644
index 0000000000..856a26762f
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/block-and-inline/width-auto-margins-set-zero-if-containing-size-smaller.txt
@@ -0,0 +1,15 @@
+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 102x57.34375 positioned [BFC] children: not-inline
+ BlockContainer <div#container> at (11,11) content-size 100x55.34375 children: not-inline
+ BlockContainer <div#child> at (72,12) content-size 50x53.34375 children: inline
+ line 0 width: 28.40625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 4, rect: [72,12 28.40625x17.46875]
+ "well"
+ line 1 width: 36.84375, height: 17.9375, bottom: 35.40625, baseline: 13.53125
+ frag 0 from TextNode start: 5, length: 5, rect: [72,29 36.84375x17.46875]
+ "hello"
+ line 2 width: 55.359375, height: 18.40625, bottom: 53.34375, baseline: 13.53125
+ frag 0 from TextNode start: 11, length: 7, rect: [72,46 55.359375x17.46875]
+ "friends"
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/block-and-inline/width-auto-margins-set-zero-if-containing-size-smaller.html b/Tests/LibWeb/Layout/input/block-and-inline/width-auto-margins-set-zero-if-containing-size-smaller.html
new file mode 100644
index 0000000000..dc07cb3f11
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/block-and-inline/width-auto-margins-set-zero-if-containing-size-smaller.html
@@ -0,0 +1,6 @@
+<!doctype html><style>
+* { border: 1px solid black; font-family: 'SerenitySans'; }
+body { position: absolute; }
+#container { width: 100px; }
+#child { width: 50px; padding-left: 60px; padding-right: 60px; margin-right: auto; margin-left: auto; }
+</style><body><div id="container"><div id="child">well hello friends</div> \ No newline at end of file