Skip to content

Truly independent web browser

LibWeb: Apply a grid item’s min size to its intrinsic contributions

sideshowbarkerb5f8d76879e8
diff --git a/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs
index 6f7de5f7d3d..2a38d5a977d 100644
--- a/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs
@@ -2731,7 +2731,7 @@ impl<'pass> GridFormattingContext<'pass> {
self.track_sizing_constraints(),
)
};
- self.add_outer_size(item, axis, content).min(maximum)
+ self.clamp_contribution(item, axis, content, maximum)
}
fn max_content_contribution(&self, item: GridItem, axis: Axis) -> CssPixels {
@@ -2773,7 +2773,41 @@ impl<'pass> GridFormattingContext<'pass> {
self.track_sizing_constraints(),
)
};
- self.add_outer_size(item, axis, content).min(maximum)
+ self.clamp_contribution(item, axis, content, maximum)
+ }
+
+ // https://drafts.csswg.org/css-sizing-3/#intrinsic-contribution
+ // A box's min-content contribution/max-content contribution in each axis is the size of the content box of a
+ // hypothetical auto-sized float that contains only that box, if that hypothetical float's containing block is
+ // zero-sized/infinitely-sized.
+ // NB: The box in that float has its min and max sizes applied, and its min size wins over its max size.
+ fn clamp_contribution(&self, item: GridItem, axis: Axis, content: CssPixels, maximum: CssPixels) -> CssPixels {
+ let contribution = self.add_outer_size(item, axis, content).min(maximum);
+ if !self.minimum_size(item, axis).is_length_percentage() {
+ return contribution;
+ }
+ // https://drafts.csswg.org/css-sizing-3/#cyclic-percentage-contribution
+ // For the min size properties, as well as for margins and paddings (and gutters), a cyclic percentage is
+ // resolved against zero for determining intrinsic size contributions.
+ // NB: Percentages resolve against the available size in the axis as well as the percentage basis, so both are
+ // zero here.
+ let mut available_space = self.item_available_space(item);
+ let mut constraints = self.track_sizing_constraints();
+ if axis.is_column() {
+ available_space.inline_size = AvailableSize::definite(CssPixels::default());
+ constraints.percentage_basis_inline_size = Some(CssPixels::default());
+ } else {
+ available_space.block_size = AvailableSize::definite(CssPixels::default());
+ constraints.percentage_basis_block_size = Some(CssPixels::default());
+ }
+ let minimum = self.sizing().calculate_inner_size_for_property(
+ sizing_context::SizedBox::new(item.box_, &self.cells_of(item)),
+ axis.sizing_axis(),
+ axis.select(SizingProperty::MinWidth, SizingProperty::MinHeight),
+ available_space,
+ constraints,
+ );
+ contribution.max(self.add_outer_size(item, axis, minimum))
}
fn content_size_suggestion(&self, item: GridItem, axis: Axis) -> CssPixels {
diff --git a/Tests/LibWeb/Layout/expected/grid/flexible-row-with-zero-minimum-honors-item-min-height.txt b/Tests/LibWeb/Layout/expected/grid/flexible-row-with-zero-minimum-honors-item-min-height.txt
new file mode 100644
index 00000000000..f7f3209db43
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/flexible-row-with-zero-minimum-honors-item-min-height.txt
@@ -0,0 +1,45 @@
+Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline overflow: [0,0 800x784]
+ BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 724 0+0+0] [BFC] children: not-inline
+ BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 706 0+0+8] children: not-inline
+ Box <div.grid> at [8,8] [0+0+0 200 0+0+584] [0+0+0 100 0+0+10] [GFC] children: not-inline
+ BlockContainer <div> at [8,8] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [8,118] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ Box <div.grid> at [8,118] [0+0+0 200 0+0+584] [0+0+0 100 0+0+10] [GFC] children: not-inline
+ BlockContainer <div> at [8,118] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: inline
+ frag 0 from TextNode start: 0, length: 4, rect: [8,118 32.140625x16] baseline: 12.796875
+ "text"
+ TextNode <#text> (not painted)
+ BlockContainer <(anonymous)> at [8,228] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ Box <div.grid> at [8,228] [0+0+0 200 0+0+584] [0+0+0 116 0+0+10] [GFC] children: not-inline
+ BlockContainer <div> at [8,228] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
+ BlockContainer <div> at [8,328] [0+0+0 200 0+0+0] [0+0+0 16 0+0+0] [BFC] children: inline
+ frag 0 from TextNode start: 0, length: 5, rect: [8,328 40.1875x16] baseline: 12.796875
+ "after"
+ TextNode <#text> (not painted)
+ BlockContainer <(anonymous)> at [8,354] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ Box <div.grid> at [8,354] [0+0+0 200 0+0+584] [0+0+0 100 0+0+10] [GFC] children: not-inline
+ BlockContainer <div> at [8,354] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [8,464] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ Box <div.grid> at [8,464] [0+0+0 200 0+0+584] [0+0+0 0 0+0+10] [GFC] children: not-inline
+ BlockContainer <div> at [8,464] [0+0+0 200 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [8,474] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ Box <div.grid> at [8,474] [0+0+0 200 0+0+584] [0+0+0 100 0+0+10] [GFC] children: not-inline
+ BlockContainer <div> at [8,474] [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [8,584] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ Box <div.grid> at [8,584] [0+0+0 200 0+0+584] [0+0+0 100 0+0+10] [GFC] children: not-inline
+ BlockContainer <div> at [8,584] [0+0+0 200 0+0+0] [0+0+0 200 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [8,694] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+ Box <div.grid> at [8,694] [0+0+0 80 0+0+704] [0+0+0 20 0+0+10] [GFC] children: not-inline
+ BlockContainer <div> at [8,694] [0+0+0 80 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [8,724] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ TextNode <#text> (not painted)
+
+SC for Viewport<#document> [0,0 800x600] (z-index: auto)
+ SC for BlockContainer<HTML> [0,0 800x724] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/grid/ratio-only-replaced-item-conflicting-height-constraints.txt b/Tests/LibWeb/Layout/expected/grid/ratio-only-replaced-item-conflicting-height-constraints.txt
index 3698bf7a7a7..7575f29e1d4 100644
--- a/Tests/LibWeb/Layout/expected/grid/ratio-only-replaced-item-conflicting-height-constraints.txt
+++ b/Tests/LibWeb/Layout/expected/grid/ratio-only-replaced-item-conflicting-height-constraints.txt
@@ -1,14 +1,14 @@
Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline
- BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 48 0+0+0] [BFC] children: not-inline
- BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 32 0+0+8] children: not-inline
- Box <div> at [8,8] [0+0+0 784 0+0+0] [0+0+0 32 0+0+0] [GFC] children: not-inline
+ BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 116 0+0+0] [BFC] children: not-inline
+ BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 100 0+0+8] children: not-inline
+ Box <div> at [8,8] [0+0+0 784 0+0+0] [0+0+0 100 0+0+0] [GFC] children: not-inline
ImageBox <img> at [8,8] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] viewport-transform=[100 0 0 100 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,40] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,108] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
- SC for BlockContainer<HTML> [0,0 800x48] (z-index: auto)
+ SC for BlockContainer<HTML> [0,0 800x116] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/grid/ratio-only-replaced-item-size-transfer-matrix.txt b/Tests/LibWeb/Layout/expected/grid/ratio-only-replaced-item-size-transfer-matrix.txt
index 50090e0651e..094ffe6358d 100644
--- a/Tests/LibWeb/Layout/expected/grid/ratio-only-replaced-item-size-transfer-matrix.txt
+++ b/Tests/LibWeb/Layout/expected/grid/ratio-only-replaced-item-size-transfer-matrix.txt
@@ -1,6 +1,6 @@
-Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline overflow: [0,0 800x657]
- BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 657 0+0+0] [BFC] children: not-inline
- BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 641 0+0+8] children: not-inline
+Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline overflow: [0,0 800x929]
+ BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 929 0+0+0] [BFC] children: not-inline
+ BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 913 0+0+8] children: not-inline
Box <div> at [8,8] [0+0+0 64 0+0+720] [0+0+0 16 0+0+0] [GFC] children: not-inline
ImageBox <img.cyclic-preferred> at [8,8] [0+0+0 32 0+0+0] [0+0+0 16 0+0+0] children: not-inline
(SVG-as-image isolated context)
@@ -33,126 +33,126 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
BlockContainer <(anonymous)> at [8,109] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,109] [0+0+0 200 0+0+584] [0+0+0 32 0+0+0] [GFC] children: not-inline
+ Box <div> at [8,109] [0+0+0 200 0+0+584] [0+0+0 100 0+0+0] [GFC] children: not-inline
ImageBox <img.transferred-minimum> at [8,109] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] viewport-transform=[100 0 0 100 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,141] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,209] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,141] [0+0+0 30 0+0+754] [0+0+0 10 0+0+0] [GFC] children: not-inline
- ImageBox <img.cyclic-calculated-transferred-minimum> at [8,141] [0+0+0 30 0+0+0] [0+0+0 15 0+0+0] children: not-inline
+ Box <div> at [8,209] [0+0+0 30 0+0+754] [0+0+0 10 0+0+0] [GFC] children: not-inline
+ ImageBox <img.cyclic-calculated-transferred-minimum> at [8,209] [0+0+0 30 0+0+0] [0+0+0 15 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 30 0+0+0] [0+0+0 15 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 30 0+0+0] [0+0+0 15 0+0+0] viewport-transform=[15 0 0 15 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,151] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,219] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,151] [0+0+0 150 0+0+634] [0+0+0 32 0+0+0] [GFC] children: not-inline
- ImageBox <img.capped-transferred-minimum> at [8,151] [0+0+0 150 0+0+0] [0+0+0 100 0+0+0] children: not-inline
+ Box <div> at [8,219] [0+0+0 150 0+0+634] [0+0+0 100 0+0+0] [GFC] children: not-inline
+ ImageBox <img.capped-transferred-minimum> at [8,219] [0+0+0 150 0+0+0] [0+0+0 100 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 150 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 150 0+0+0] [0+0+0 100 0+0+0] viewport-transform=[75 0 0 75 0 12.5] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,183] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,319] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,183] [0+0+0 150 0+0+634] [0+0+0 32 0+0+0] [GFC] children: not-inline
- ImageBox <img.calculated-capped-transferred-minimum> at [8,183] [0+0+0 150 0+0+0] [0+0+0 100 0+0+0] children: not-inline
+ Box <div> at [8,319] [0+0+0 150 0+0+634] [0+0+0 100 0+0+0] [GFC] children: not-inline
+ ImageBox <img.calculated-capped-transferred-minimum> at [8,319] [0+0+0 150 0+0+0] [0+0+0 100 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 150 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 150 0+0+0] [0+0+0 100 0+0+0] viewport-transform=[75 0 0 75 0 12.5] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,215] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,419] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,215] [0+0+0 200 0+0+584] [0+0+0 32 0+0+0] [GFC] children: not-inline
- ImageBox <img.cyclic-maximum> at [8,215] [0+0+0 100 0+0+0] [0+0+0 100 0+0+0] children: not-inline
+ Box <div> at [8,419] [0+0+0 200 0+0+584] [0+0+0 100 0+0+0] [GFC] children: not-inline
+ ImageBox <img.cyclic-maximum> at [8,419] [0+0+0 100 0+0+0] [0+0+0 100 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 100 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 100 0+0+0] [0+0+0 100 0+0+0] viewport-transform=[50 0 0 50 0 25] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,247] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,519] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,247] [0+0+0 10 0+0+774] [0+0+0 2 0+0+0] [GFC] children: not-inline
- ImageBox <img.cyclic-minimum> at [8,247] [0+0+0 15 0+0+0] [0+0+0 2 0+0+0] children: not-inline
+ Box <div> at [8,519] [0+0+0 10 0+0+774] [0+0+0 2 0+0+0] [GFC] children: not-inline
+ ImageBox <img.cyclic-minimum> at [8,519] [0+0+0 15 0+0+0] [0+0+0 2 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 15 0+0+0] [0+0+0 2 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 15 0+0+0] [0+0+0 2 0+0+0] viewport-transform=[2 0 0 2 5.5 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,249] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,521] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,249] [0+0+0 0 0+0+784] [0+0+0 0 0+0+0] [GFC] children: not-inline
- ImageBox <img.cyclic-zero-minimum> at [8,249] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
+ Box <div> at [8,521] [0+0+0 0 0+0+784] [0+0+0 0 0+0+0] [GFC] children: not-inline
+ ImageBox <img.cyclic-zero-minimum> at [8,521] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] viewport-transform=[0 0 0 0 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,249] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,521] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,249] [0+0+0 0 0+0+784] [0+0+0 0 0+0+0] [GFC] children: not-inline
- ImageBox <img.cyclic-zero-calculated-minimum> at [8,249] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
+ Box <div> at [8,521] [0+0+0 0 0+0+784] [0+0+0 0 0+0+0] [GFC] children: not-inline
+ ImageBox <img.cyclic-zero-calculated-minimum> at [8,521] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] viewport-transform=[0 0 0 0 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,249] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,521] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,249] [0+0+0 80 0+0+704] [0+0+0 32 0+0+0] [GFC] children: not-inline
- ImageBox <img.calculated-minimum> at [8,249] [0+0+0 80 0+0+0] [0+0+0 32 0+0+0] children: not-inline
+ Box <div> at [8,521] [0+0+0 80 0+0+704] [0+0+0 32 0+0+0] [GFC] children: not-inline
+ ImageBox <img.calculated-minimum> at [8,521] [0+0+0 80 0+0+0] [0+0+0 32 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 80 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 80 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[32 0 0 32 8 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,281] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,553] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,281] [0+0+0 200 0+0+584] [0+0+0 100 0+0+0] [GFC] children: not-inline
- ImageBox <img.fixed-minimum-only> at [8,281] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
+ Box <div> at [8,553] [0+0+0 200 0+0+584] [0+0+0 100 0+0+0] [GFC] children: not-inline
+ ImageBox <img.fixed-minimum-only> at [8,553] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] viewport-transform=[100 0 0 100 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,381] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,653] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,381] [0+0+0 200 0+0+584] [0+0+0 100 0+0+0] [GFC] children: not-inline
- ImageBox <img.calculated-minimum-only> at [8,381] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
+ Box <div> at [8,653] [0+0+0 200 0+0+584] [0+0+0 100 0+0+0] [GFC] children: not-inline
+ ImageBox <img.calculated-minimum-only> at [8,653] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] viewport-transform=[100 0 0 100 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,481] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,753] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,481] [0+0+0 84 0+0+700] [0+0+0 52 0+0+0] [GFC] children: not-inline
- ImageBox <img.border-box-maximum> at [18,491] [0+10+0 64 0+10+0] [0+10+0 32 0+10+0] children: not-inline
+ Box <div> at [8,753] [0+0+0 84 0+0+700] [0+0+0 52 0+0+0] [GFC] children: not-inline
+ ImageBox <img.border-box-maximum> at [18,763] [0+10+0 64 0+10+0] [0+10+0 32 0+10+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 64 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 64 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[32 0 0 32 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,533] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,805] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div.definite-height> at [8,533] [0+0+0 100 0+0+684] [0+0+0 100 0+0+0] [GFC] children: not-inline
- ImageBox <img.percentage-maximum> at [8,533] [0+0+0 100 0+0+0] [0+0+0 50 0+0+50] children: not-inline
+ Box <div.definite-height> at [8,805] [0+0+0 100 0+0+684] [0+0+0 100 0+0+0] [GFC] children: not-inline
+ ImageBox <img.percentage-maximum> at [8,805] [0+0+0 100 0+0+0] [0+0+0 50 0+0+50] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 100 0+0+0] [0+0+0 50 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 100 0+0+0] [0+0+0 50 0+0+0] viewport-transform=[50 0 0 50 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,633] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,905] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div.available-width> at [8,633] [0+0+0 784 0+0+0] [0+0+0 16 0+0+0] [GFC] children: not-inline
- ImageBox <img.cyclic-preferred> at [8,633] [0+0+0 32 0+0+0] [0+0+0 16 0+0+0] children: not-inline
+ Box <div.available-width> at [8,905] [0+0+0 784 0+0+0] [0+0+0 16 0+0+0] [GFC] children: not-inline
+ ImageBox <img.cyclic-preferred> at [8,905] [0+0+0 32 0+0+0] [0+0+0 16 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 16 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 16 0+0+0] viewport-transform=[16 0 0 16 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,649] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,921] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div.available-width> at [8,649] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] [GFC] children: not-inline
- ImageBox <img.cyclic-zero-minimum> at [8,649] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
+ Box <div.available-width> at [8,921] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] [GFC] children: not-inline
+ ImageBox <img.cyclic-zero-minimum> at [8,921] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] viewport-transform=[0 0 0 0 0 0] [SVG] children: not-inline
SVGGeometryBox <rect> at [0,0] [0+0+0 2 0+0+0] [0+0+0 1 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,649] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,921] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
- SC for BlockContainer<HTML> [0,0 800x657] (z-index: auto)
+ SC for BlockContainer<HTML> [0,0 800x929] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/grid/replaced-item-preferred-ratio-source-matrix.txt b/Tests/LibWeb/Layout/expected/grid/replaced-item-preferred-ratio-source-matrix.txt
index 91519533fe1..772be080f0c 100644
--- a/Tests/LibWeb/Layout/expected/grid/replaced-item-preferred-ratio-source-matrix.txt
+++ b/Tests/LibWeb/Layout/expected/grid/replaced-item-preferred-ratio-source-matrix.txt
@@ -1,6 +1,6 @@
-Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline overflow: [0,0 808x1884]
- BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 1884 0+0+0] [BFC] children: not-inline
- BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 1868 0+0+8] children: not-inline
+Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline overflow: [0,0 808x2020]
+ BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 2020 0+0+0] [BFC] children: not-inline
+ BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 2004 0+0+8] children: not-inline
Box <div> at [8,8] [0+0+0 64 0+0+720] [0+0+0 32 0+0+0] [GFC] children: not-inline
ImageBox <img> at [8,8] [0+0+0 64 0+0+0] [0+0+0 32 0+0+0] children: not-inline
(SVG-as-image isolated context)
@@ -71,90 +71,90 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
BlockContainer <(anonymous)> at [8,1644] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1644] [0+0+0 200 0+0+584] [0+0+0 32 0+0+0] [GFC] children: not-inline
+ Box <div> at [8,1644] [0+0+0 200 0+0+584] [0+0+0 100 0+0+0] [GFC] children: not-inline
ImageBox <img.css-ratio.conflicting-heights> at [8,1644] [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1676] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1744] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1676] [0+0+0 300 0+0+484] [0+0+0 32 0+0+0] [GFC] children: not-inline
- ImageBox <img.cyclic-zero-minimum> at [8,1676] [0+0+0 300 0+0+0] [0+0+0 32 0+0+0] children: not-inline
+ Box <div> at [8,1744] [0+0+0 300 0+0+484] [0+0+0 32 0+0+0] [GFC] children: not-inline
+ ImageBox <img.cyclic-zero-minimum> at [8,1744] [0+0+0 300 0+0+0] [0+0+0 32 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1708] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1776] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1708] [0+0+0 300 0+0+484] [0+0+0 2 0+0+0] [GFC] children: not-inline
- ImageBox <img.cyclic-calculated-minimum> at [8,1708] [0+0+0 300 0+0+0] [0+0+0 2 0+0+0] children: not-inline
+ Box <div> at [8,1776] [0+0+0 300 0+0+484] [0+0+0 2 0+0+0] [GFC] children: not-inline
+ ImageBox <img.cyclic-calculated-minimum> at [8,1776] [0+0+0 300 0+0+0] [0+0+0 2 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1710] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1778] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1710] [0+0+0 0 0+0+784] [0+0+0 0 0+0+0] [GFC] children: not-inline
- ImageBox <img.css-ratio.cyclic-zero-minimum> at [8,1710] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
+ Box <div> at [8,1778] [0+0+0 0 0+0+784] [0+0+0 0 0+0+0] [GFC] children: not-inline
+ ImageBox <img.css-ratio.cyclic-zero-minimum> at [8,1778] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1710] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1778] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1710] [0+0+0 0 0+0+784] [0+0+0 0 0+0+0] [GFC] children: not-inline
- ImageBox <img.css-ratio.cyclic-zero-minimum.unconstrained> at [8,1710] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
+ Box <div> at [8,1778] [0+0+0 0 0+0+784] [0+0+0 0 0+0+0] [GFC] children: not-inline
+ ImageBox <img.css-ratio.cyclic-zero-minimum.unconstrained> at [8,1778] [0+0+0 0 0+0+0] [0+0+0 0 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1710] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1778] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1710] [0+0+0 10 0+0+774] [0+0+0 2 0+0+0] [GFC] children: not-inline
- ImageBox <img.css-ratio.cyclic-calculated-minimum> at [8,1710] [0+0+0 15 0+0+0] [0+0+0 2 0+0+0] children: not-inline
+ Box <div> at [8,1778] [0+0+0 10 0+0+774] [0+0+0 2 0+0+0] [GFC] children: not-inline
+ ImageBox <img.css-ratio.cyclic-calculated-minimum> at [8,1778] [0+0+0 15 0+0+0] [0+0+0 2 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1712] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1780] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1712] [0+0+0 64 0+0+720] [0+0+0 16 0+0+0] [GFC] children: not-inline
- ImageBox <img.css-ratio.cyclic-preferred> at [8,1712] [0+0+0 32 0+0+0] [0+0+0 16 0+0+0] children: not-inline
+ Box <div> at [8,1780] [0+0+0 64 0+0+720] [0+0+0 16 0+0+0] [GFC] children: not-inline
+ ImageBox <img.css-ratio.cyclic-preferred> at [8,1780] [0+0+0 32 0+0+0] [0+0+0 16 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1728] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1796] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1728] [0+0+0 200 0+0+584] [0+0+0 32 0+0+0] [GFC] children: not-inline
- ImageBox <img.css-ratio.cyclic-maximum> at [8,1728] [0+0+0 100 0+0+0] [0+0+0 100 0+0+0] children: not-inline
+ Box <div> at [8,1796] [0+0+0 200 0+0+584] [0+0+0 100 0+0+0] [GFC] children: not-inline
+ ImageBox <img.css-ratio.cyclic-maximum> at [8,1796] [0+0+0 100 0+0+0] [0+0+0 100 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1760] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1896] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1760] [0+0+0 20 0+0+764] [0+0+0 20 0+0+0] [GFC] children: not-inline
- ImageBox <img.css-ratio.border-box-cyclic-minimum> at [18,1770] [0+10+0 0 0+10+0] [0+10+0 0 0+10+0] children: not-inline
+ Box <div> at [8,1896] [0+0+0 20 0+0+764] [0+0+0 20 0+0+0] [GFC] children: not-inline
+ ImageBox <img.css-ratio.border-box-cyclic-minimum> at [18,1906] [0+10+0 0 0+10+0] [0+10+0 0 0+10+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1780] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1916] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1780] [0+0+0 32 0+0+752] [0+0+0 32 0+0+0] [GFC] children: not-inline
- ImageBox <img.css-override> at [8,1780] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] children: not-inline
+ Box <div> at [8,1916] [0+0+0 32 0+0+752] [0+0+0 32 0+0+0] [GFC] children: not-inline
+ ImageBox <img.css-override> at [8,1916] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[16 0 0 16 0 8] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1812] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1948] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1812] [0+0+0 64 0+0+720] [0+0+0 32 0+0+0] [GFC] children: not-inline
- ImageBox <img.css-auto-with-ratio> at [8,1812] [0+0+0 64 0+0+0] [0+0+0 32 0+0+0] children: not-inline
+ Box <div> at [8,1948] [0+0+0 64 0+0+720] [0+0+0 32 0+0+0] [GFC] children: not-inline
+ ImageBox <img.css-auto-with-ratio> at [8,1948] [0+0+0 64 0+0+0] [0+0+0 32 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[16 0 0 16 0 8] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1844] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,1980] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
- Box <div> at [8,1844] [0+0+0 32 0+0+752] [0+0+0 32 0+0+0] [GFC] children: not-inline
- ImageBox <img.css-auto-with-ratio> at [8,1844] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] children: not-inline
+ Box <div> at [8,1980] [0+0+0 32 0+0+752] [0+0+0 32 0+0+0] [GFC] children: not-inline
+ ImageBox <img.css-auto-with-ratio> at [8,1980] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] children: not-inline
(SVG-as-image isolated context)
Viewport <#document> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] [BFC] children: not-inline
SVGSVGBox <svg> at [0,0] [0+0+0 32 0+0+0] [0+0+0 32 0+0+0] viewport-transform=[1 0 0 1 0 0] [SVG] children: not-inline
- BlockContainer <(anonymous)> at [8,1876] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
+ BlockContainer <(anonymous)> at [8,2012] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
- SC for BlockContainer<HTML> [0,0 800x1884] (z-index: auto)
+ SC for BlockContainer<HTML> [0,0 800x2020] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/input/grid/flexible-row-with-zero-minimum-honors-item-min-height.html b/Tests/LibWeb/Layout/input/grid/flexible-row-with-zero-minimum-honors-item-min-height.html
new file mode 100644
index 00000000000..0c6bfd5efbc
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/flexible-row-with-zero-minimum-honors-item-min-height.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<style>
+ .grid { display: grid; grid-auto-rows: minmax(0, 1fr); width: 200px; margin-bottom: 10px; }
+ .grid > div { background: lightblue; }
+</style>
+<div class="grid"><div style="min-height: 100px"></div></div>
+<div class="grid"><div style="min-height: 100px">text</div></div>
+<div class="grid" style="grid-template-rows: minmax(0, 1fr) auto"><div style="min-height: 100px"></div><div>after</div></div>
+<div class="grid"><div style="min-height: 100px; max-height: 50px"></div></div>
+<div class="grid"><div style="min-height: 50%"></div></div>
+<div class="grid"><div style="min-height: calc(100px + 50%)"></div></div>
+<div class="grid"><div style="height: 100px; min-height: 200%"></div></div>
+<div class="grid" style="grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; width: max-content"><div style="min-width: 80px; height: 20px"></div></div>
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-items/grid-automatic-minimum-intrinsic-aspect-ratio-001.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-items/grid-automatic-minimum-intrinsic-aspect-ratio-001.txt
index 161b3d25687..f46146753c2 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-items/grid-automatic-minimum-intrinsic-aspect-ratio-001.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-items/grid-automatic-minimum-intrinsic-aspect-ratio-001.txt
@@ -2,19 +2,19 @@ Harness status: OK
Found 14 tests
-8 Pass
-6 Fail
+12 Pass
+2 Fail
Pass .container 1
Fail .container 2
Fail .container 3
-Fail .container 4
+Pass .container 4
Pass .container 5
Pass .container 6
-Fail .container 7
+Pass .container 7
Pass .container 8
Pass .container 9
Pass .container 10
-Fail .container 11
+Pass .container 11
Pass .container 12
Pass .container 13
-Fail .container 14
\ No newline at end of file
+Pass .container 14
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-lanes/items/column-automatic-minimum-for-auto.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-lanes/items/column-automatic-minimum-for-auto.txt
index 0bb350c95bf..de6e0434415 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-lanes/items/column-automatic-minimum-for-auto.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-lanes/items/column-automatic-minimum-for-auto.txt
@@ -2,9 +2,8 @@ Harness status: OK
Found 4 tests
-3 Pass
-1 Fail
+4 Pass
Pass Check that min-width is honored when sizing auto columns.
Pass Check that min-width is honored when sizing auto columns and spanning grid items.
-Fail Check the interactions between width and min-width and auto tracks.
+Pass Check the interactions between width and min-width and auto tracks.
Pass Check that borders and paddings are considering when computing min sizes.
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-lanes/items/row-automatic-minimum-for-auto.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-lanes/items/row-automatic-minimum-for-auto.txt
index 699aae302ca..78c6547a392 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-lanes/items/row-automatic-minimum-for-auto.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-grid/grid-lanes/items/row-automatic-minimum-for-auto.txt
@@ -2,9 +2,8 @@ Harness status: OK
Found 4 tests
-3 Pass
-1 Fail
+4 Pass
Pass Check that min-height is honored when sizing auto rows.
Pass Check that min-height is honored when sizing auto rows and spanning grid items.
-Fail Check the interactions between height and min-height and auto tracks.
+Pass Check the interactions between height and min-height and auto tracks.
Pass Check that borders and paddings are considering when computing min sizes.
\ No newline at end of file