Skip to content

Truly independent web browser

LibWeb: Clamp flex lines by percentage max size of the container

Andreas Klingdde578d78dcc
diff --git a/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs
index f9825b6d01c..2cba201b454 100644
--- a/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs
@@ -948,7 +948,7 @@ impl<'pass> FlexFormattingContext<'pass> {
self.facts(self.run.box_).is_replaced_box(),
self.cross_axis_is_horizontal(),
self.available_space_for_items.unwrap().cross,
- self.item_containing_block_constraints(),
+ self.layout_input.as_ref().unwrap().containing_block_constraints,
)
}
diff --git a/Tests/LibWeb/Layout/expected/abspos-auto-height-flex-and-grid-roots.txt b/Tests/LibWeb/Layout/expected/abspos-auto-height-flex-and-grid-roots.txt
index 24309c084be..e676a5b2edc 100644
--- a/Tests/LibWeb/Layout/expected/abspos-auto-height-flex-and-grid-roots.txt
+++ b/Tests/LibWeb/Layout/expected/abspos-auto-height-flex-and-grid-roots.txt
@@ -26,8 +26,8 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
BlockContainer <div.cb> at [0,1200] positioned [0+0+0 400 0+0+400] [0+0+0 300 0+0+0] children: not-inline
Box <div#rowMaxPercent.root.row> at [3,1203] positioned flex-container(row) [0+0+3 200 3+0+0] [0+0+3 30 3+0+0] [FFC] children: not-inline
BlockContainer <div.item> at [3,1203] flex-item [0+0+0 20 0+0+0] [0+0+0 50 0+0+0] [BFC] children: not-inline
- BlockContainer <div> at [23,1203] flex-item [0+0+0 20 0+0+0] [0+0+0 50 0+0+0] [BFC] children: not-inline
- BlockContainer <div.half> at [23,1203] [0+0+0 10 0+0+10] [0+0+0 25 0+0+0] children: not-inline
+ BlockContainer <div> at [23,1203] flex-item [0+0+0 20 0+0+0] [0+0+0 30 0+0+0] [BFC] children: not-inline
+ BlockContainer <div.half> at [23,1203] [0+0+0 10 0+0+10] [0+0+0 15 0+0+0] children: not-inline
BlockContainer <div.cb> at [0,1500] positioned [0+0+0 400 0+0+400] [0+0+0 300 0+0+0] children: not-inline
Box <div#gridRows.root.grid> at [0,1500] positioned [0+0+0 200 0+0+0] [0+0+0 80 0+0+0] [GFC] children: not-inline
BlockContainer <div.item> at [0,1500] [0+0+0 20 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
diff --git a/Tests/LibWeb/Layout/expected/flex/single-line-clamped-by-percentage-max-height-of-auto-height-container.txt b/Tests/LibWeb/Layout/expected/flex/single-line-clamped-by-percentage-max-height-of-auto-height-container.txt
index 9dbbb2cd322..ce515692a4e 100644
--- a/Tests/LibWeb/Layout/expected/flex/single-line-clamped-by-percentage-max-height-of-auto-height-container.txt
+++ b/Tests/LibWeb/Layout/expected/flex/single-line-clamped-by-percentage-max-height-of-auto-height-container.txt
@@ -2,9 +2,9 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline
BlockContainer <body> at [0,0] [0+0+0 800 0+0+0] [0+0+0 0 0+0+0] children: not-inline
BlockContainer <div.fixed> at [0,0] positioned [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline
- Box <div.sheet> at [0,0] flex-container(row) [0+0+0 800 0+0+0] [0+0+0 300 0+0+0] [FFC] children: not-inline overflow: [0,0 800x3000]
- Box <div.layer> at [0,0] flex-container(row) flex-item [0+0+0 100 0+0+0] [0+0+0 3000 0+0+0] [FFC] children: not-inline
- BlockContainer <div.column> at [0,0] flex-item [0+0+0 100 0+0+0] [0+0+0 3000 0+0+0] [BFC] children: not-inline
+ Box <div.sheet> at [0,0] flex-container(row) [0+0+0 800 0+0+0] [0+0+0 300 0+0+0] [FFC] children: not-inline
+ Box <div.layer> at [0,0] flex-container(row) flex-item [0+0+0 100 0+0+0] [0+0+0 300 0+0+0] [FFC] children: not-inline
+ BlockContainer <div.column> at [0,0] flex-item [0+0+0 100 0+0+0] [0+0+0 300 0+0+0] [BFC] children: not-inline overflow: [0,0 100x3000]
BlockContainer <div.content> at [0,0] [0+0+0 100 0+0+0] [0+0+0 3000 0+0+0] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)