summaryrefslogtreecommitdiff
path: root/Tests/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-06-01 14:20:11 +0200
committerAndreas Kling <kling@serenityos.org>2023-06-01 15:11:48 +0200
commit3f9cfa144c4a5739c68ac61b6520ee759ae44f88 (patch)
tree3de4e714c53aea8af0b3204e37794ec6d681dd9a /Tests/LibWeb
parent9c74f49b1ddacd56dd35667b0fa76ff4de422c19 (diff)
downloadserenity-3f9cfa144c4a5739c68ac61b6520ee759ae44f88.zip
LibWeb: Allow infinitely long flex lines when sizing under max-content
If the flex container is being sized under a max-content main size constraint, there is effectively infinite space available for flex items. Thus, flex lines should be allowed to be infinitely long. This is a little awkward, because the spec doesn't mention specifics about how to resolve flexible lengths during intrninsic sizing. I've marked the spec deviations with big "AD-HOC" comments.
Diffstat (limited to 'Tests/LibWeb')
-rw-r--r--Tests/LibWeb/Layout/expected/flex/flex-container-intrinsic-cross-size-with-max-content-main-size.txt9
-rw-r--r--Tests/LibWeb/Layout/input/flex/flex-container-intrinsic-cross-size-with-max-content-main-size.html12
2 files changed, 21 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/flex/flex-container-intrinsic-cross-size-with-max-content-main-size.txt b/Tests/LibWeb/Layout/expected/flex/flex-container-intrinsic-cross-size-with-max-content-main-size.txt
new file mode 100644
index 0000000000..3d7eda797f
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/flex/flex-container-intrinsic-cross-size-with-max-content-main-size.txt
@@ -0,0 +1,9 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x53.46875 [BFC] children: not-inline
+ BlockContainer <body.outer> at (18,18) content-size 280.84375x17.46875 children: not-inline
+ Box <div.inner> at (18,18) content-size 280.84375x17.46875 flex-container(row) [FFC] children: not-inline
+ BlockContainer <(anonymous)> at (18,18) content-size 280.84375x17.46875 flex-item [BFC] children: inline
+ line 0 width: 280.84375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 35, rect: [18,18 280.84375x17.46875]
+ "this text should be all on one line"
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/flex/flex-container-intrinsic-cross-size-with-max-content-main-size.html b/Tests/LibWeb/Layout/input/flex/flex-container-intrinsic-cross-size-with-max-content-main-size.html
new file mode 100644
index 0000000000..9ff4ad9d24
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/flex/flex-container-intrinsic-cross-size-with-max-content-main-size.html
@@ -0,0 +1,12 @@
+<!doctype html><style>
+ html { background: white; }
+ .outer {
+ width: max-content;
+ padding: 10px;
+ background: pink;
+ }
+ .inner {
+ display: flex;
+ background: orange;
+ }
+</style><body class="outer"><div class="inner">this text should be all on one line \ No newline at end of file