summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-05-26 19:08:28 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-27 05:47:54 +0200
commit8ba7bd1b67f7d028205b541cec4856e7aecc2907 (patch)
tree9d1e9418c1b887230381979aae5022b49ef3423f /Tests
parent1bb4e5c4288dec5116f3938e5eb7816bba181759 (diff)
downloadserenity-8ba7bd1b67f7d028205b541cec4856e7aecc2907.zip
LibWeb: Accept fit-content as a value for min-width and max-width
This starts working immediately in BFC thanks to calculate_inner_width being used for width constraints. :^)
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibWeb/Layout/expected/block-and-inline/block-with-fit-content-width-constraints.txt15
-rw-r--r--Tests/LibWeb/Layout/input/block-and-inline/block-with-fit-content-width-constraints.html13
2 files changed, 28 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/block-with-fit-content-width-constraints.txt b/Tests/LibWeb/Layout/expected/block-and-inline/block-with-fit-content-width-constraints.txt
new file mode 100644
index 0000000000..a7f3280871
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/block-and-inline/block-with-fit-content-width-constraints.txt
@@ -0,0 +1,15 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (1,1) content-size 798x56.9375 [BFC] children: not-inline
+ BlockContainer <body> at (10,10) content-size 780x38.9375 children: not-inline
+ BlockContainer <div.box> at (11,11) content-size 138.28125x17.46875 children: inline
+ line 0 width: 138.28125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 18, rect: [11,11 138.28125x17.46875]
+ "Well hello friends"
+ TextNode <#text>
+ BlockContainer <div.box2> at (11,30.46875) content-size 138.28125x17.46875 children: inline
+ line 0 width: 138.28125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 18, rect: [11,30.46875 138.28125x17.46875]
+ "Well hello friends"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (10,48.9375) content-size 780x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/block-and-inline/block-with-fit-content-width-constraints.html b/Tests/LibWeb/Layout/input/block-and-inline/block-with-fit-content-width-constraints.html
new file mode 100644
index 0000000000..3bd245414c
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/block-and-inline/block-with-fit-content-width-constraints.html
@@ -0,0 +1,13 @@
+<!doctype html><style>
+* { border: 1px solid black; }
+.box {
+ background: orange;
+ min-width: fit-content;
+ width: 10px;
+}
+.box2 {
+ background: pink;
+ max-width: fit-content;
+ width: 1000px;
+}
+</style><div class="box">Well hello friends</div><div class="box2">Well hello friends</div>