Skip to content

Truly independent web browser

LibWeb: Fix the transferred size suggestion of grid items

Andreas Klingcf21afbab900
diff --git a/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs
index 93bbf4b1afa..d3ba7c383e9 100644
--- a/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs
@@ -2153,16 +2153,40 @@ impl<'pass> GridFormattingContext<'pass> {
// If the item has a preferred aspect ratio and its preferred size in the opposite axis is definite, then the transferred
// size suggestion is that size (clamped by the opposite-axis minimum and maximum sizes if they are definite), converted
// through the aspect ratio. It is otherwise undefined.
- let preferred_aspect_ratio = self.facts(item.box_).preferred_aspect_ratio()?;
-
- let preferred_size_in_opposite_axis = self.preferred_size(item, axis.opposite());
- if preferred_size_in_opposite_axis.is_length() {
- let opposite_axis_size = preferred_size_in_opposite_axis.to_px(CssPixels::default());
- // FIXME: Clamp by opposite-axis minimum and maximum sizes if they are definite
- return Some(preferred_aspect_ratio.multiply(opposite_axis_size));
+ self.facts(item.box_).preferred_aspect_ratio()?;
+ if !self.preferred_size(item, axis.opposite()).is_length() {
+ return None;
}
-
- None
+ let opposite = axis.opposite();
+ let available = self.item_available_space(item);
+ let constraints = self.track_sizing_constraints();
+ let inner_size = |property: SizingProperty| {
+ self.sizing().calculate_inner_size_for_property(
+ item.box_,
+ opposite.sizing_axis(),
+ property,
+ available,
+ constraints,
+ )
+ };
+ let mut opposite_axis_size = inner_size(opposite.select(SizingProperty::Width, SizingProperty::Height));
+ if self.maximum_size(item, opposite).is_length() {
+ opposite_axis_size = opposite_axis_size.min(inner_size(
+ opposite.select(SizingProperty::MaxWidth, SizingProperty::MaxHeight),
+ ));
+ }
+ if self.minimum_size(item, opposite).is_length() {
+ opposite_axis_size = opposite_axis_size.max(inner_size(
+ opposite.select(SizingProperty::MinWidth, SizingProperty::MinHeight),
+ ));
+ }
+ Some(if axis.is_column() {
+ self.sizing()
+ .content_inline_size_from_aspect_ratio(item.box_, opposite_axis_size)
+ } else {
+ self.sizing()
+ .content_block_size_from_aspect_ratio(item.box_, opposite_axis_size)
+ })
}
fn content_based_minimum_size(&self, item: GridItem, axis: Axis) -> CssPixels {
diff --git a/Tests/LibWeb/Text/expected/css/aspect-ratio-min-max-transfer-matrix.txt b/Tests/LibWeb/Text/expected/css/aspect-ratio-min-max-transfer-matrix.txt
index 7eb162f2160..42ceebe3bd7 100644
--- a/Tests/LibWeb/Text/expected/css/aspect-ratio-min-max-transfer-matrix.txt
+++ b/Tests/LibWeb/Text/expected/css/aspect-ratio-min-max-transfer-matrix.txt
@@ -5743,21 +5743,21 @@ grid block width=80px height=auto tall border-box-max-width: 40x315 child=152.5
grid block width=80px height=100% empty min-height: 80x60 child=30
grid block width=80px height=100% empty min-height-large: 80x150 child=75
grid block width=80px height=100% empty max-height: 80x30 child=15
-grid block width=80px height=100% empty min-width: 150x160 child=80
-grid block width=80px height=100% empty max-width: 40x160 child=80
+grid block width=80px height=100% empty min-width: 150x75 child=37.5
+grid block width=80px height=100% empty max-width: 40x20 child=10
grid block width=80px height=100% empty min-width-max-height: 150x30 child=15
grid block width=80px height=100% empty max-width-min-height: 40x60 child=30
grid block width=80px height=100% empty border-box-min-height: 80x60 child=25
-grid block width=80px height=100% empty border-box-max-width: 40x170 child=80
+grid block width=80px height=100% empty border-box-max-width: 40x20 child=5
grid block width=80px height=100% tall min-height: 80x60 child=30
grid block width=80px height=100% tall min-height-large: 80x150 child=75
grid block width=80px height=100% tall max-height: 80x30 child=15
-grid block width=80px height=100% tall min-width: 150x160 child=80
-grid block width=80px height=100% tall max-width: 40x160 child=80
+grid block width=80px height=100% tall min-width: 150x75 child=37.5
+grid block width=80px height=100% tall max-width: 40x20 child=10
grid block width=80px height=100% tall min-width-max-height: 150x30 child=15
grid block width=80px height=100% tall max-width-min-height: 40x60 child=30
grid block width=80px height=100% tall border-box-min-height: 80x60 child=25
-grid block width=80px height=100% tall border-box-max-width: 40x170 child=80
+grid block width=80px height=100% tall border-box-max-width: 40x20 child=5
grid block width=80px height=40px empty min-height: 80x60 child=30
grid block width=80px height=40px empty min-height-large: 80x150 child=75
grid block width=80px height=40px empty max-height: 80x30 child=15
@@ -5813,7 +5813,7 @@ grid block width=50% height=100% tall max-width-min-height: 40x60 child=30
grid block width=50% height=100% tall border-box-min-height: 100x60 child=25
grid block width=50% height=100% tall border-box-max-width: 40x20 child=5
grid block width=50% height=40px empty min-height: 100x60 child=30
-grid block width=50% height=40px empty min-height-large: 100x150 child=75
+grid block width=50% height=40px empty min-height-large: 150x150 child=75
grid block width=50% height=40px empty max-height: 100x30 child=15
grid block width=50% height=40px empty min-width: 150x40 child=20
grid block width=50% height=40px empty max-width: 40x40 child=20
@@ -5822,7 +5822,7 @@ grid block width=50% height=40px empty max-width-min-height: 40x60 child=30
grid block width=50% height=40px empty border-box-min-height: 100x60 child=25
grid block width=50% height=40px empty border-box-max-width: 40x40 child=15
grid block width=50% height=40px tall min-height: 100x60 child=30
-grid block width=50% height=40px tall min-height-large: 100x150 child=75
+grid block width=50% height=40px tall min-height-large: 150x150 child=75
grid block width=50% height=40px tall max-height: 100x30 child=15
grid block width=50% height=40px tall min-width: 150x40 child=20
grid block width=50% height=40px tall max-width: 40x40 child=20
@@ -5905,21 +5905,21 @@ grid flow-root width=80px height=auto tall border-box-max-width: 40x315 child=15
grid flow-root width=80px height=100% empty min-height: 80x60 child=30
grid flow-root width=80px height=100% empty min-height-large: 80x150 child=75
grid flow-root width=80px height=100% empty max-height: 80x30 child=15
-grid flow-root width=80px height=100% empty min-width: 150x160 child=80
-grid flow-root width=80px height=100% empty max-width: 40x160 child=80
+grid flow-root width=80px height=100% empty min-width: 150x75 child=37.5
+grid flow-root width=80px height=100% empty max-width: 40x20 child=10
grid flow-root width=80px height=100% empty min-width-max-height: 150x30 child=15
grid flow-root width=80px height=100% empty max-width-min-height: 40x60 child=30
grid flow-root width=80px height=100% empty border-box-min-height: 80x60 child=25
-grid flow-root width=80px height=100% empty border-box-max-width: 40x170 child=80
+grid flow-root width=80px height=100% empty border-box-max-width: 40x20 child=5
grid flow-root width=80px height=100% tall min-height: 80x60 child=30
grid flow-root width=80px height=100% tall min-height-large: 80x150 child=75
grid flow-root width=80px height=100% tall max-height: 80x30 child=15
-grid flow-root width=80px height=100% tall min-width: 150x160 child=80
-grid flow-root width=80px height=100% tall max-width: 40x160 child=80
+grid flow-root width=80px height=100% tall min-width: 150x75 child=37.5
+grid flow-root width=80px height=100% tall max-width: 40x20 child=10
grid flow-root width=80px height=100% tall min-width-max-height: 150x30 child=15
grid flow-root width=80px height=100% tall max-width-min-height: 40x60 child=30
grid flow-root width=80px height=100% tall border-box-min-height: 80x60 child=25
-grid flow-root width=80px height=100% tall border-box-max-width: 40x170 child=80
+grid flow-root width=80px height=100% tall border-box-max-width: 40x20 child=5
grid flow-root width=80px height=40px empty min-height: 80x60 child=30
grid flow-root width=80px height=40px empty min-height-large: 80x150 child=75
grid flow-root width=80px height=40px empty max-height: 80x30 child=15
@@ -5975,7 +5975,7 @@ grid flow-root width=50% height=100% tall max-width-min-height: 40x60 child=30
grid flow-root width=50% height=100% tall border-box-min-height: 100x60 child=25
grid flow-root width=50% height=100% tall border-box-max-width: 40x20 child=5
grid flow-root width=50% height=40px empty min-height: 100x60 child=30
-grid flow-root width=50% height=40px empty min-height-large: 100x150 child=75
+grid flow-root width=50% height=40px empty min-height-large: 150x150 child=75
grid flow-root width=50% height=40px empty max-height: 100x30 child=15
grid flow-root width=50% height=40px empty min-width: 150x40 child=20
grid flow-root width=50% height=40px empty max-width: 40x40 child=20
@@ -5984,7 +5984,7 @@ grid flow-root width=50% height=40px empty max-width-min-height: 40x60 child=30
grid flow-root width=50% height=40px empty border-box-min-height: 100x60 child=25
grid flow-root width=50% height=40px empty border-box-max-width: 40x40 child=15
grid flow-root width=50% height=40px tall min-height: 100x60 child=30
-grid flow-root width=50% height=40px tall min-height-large: 100x150 child=75
+grid flow-root width=50% height=40px tall min-height-large: 150x150 child=75
grid flow-root width=50% height=40px tall max-height: 100x30 child=15
grid flow-root width=50% height=40px tall min-width: 150x40 child=20
grid flow-root width=50% height=40px tall max-width: 40x40 child=20
@@ -6067,21 +6067,21 @@ grid inline-block width=80px height=auto tall border-box-max-width: 40x315 child
grid inline-block width=80px height=100% empty min-height: 80x60 child=30
grid inline-block width=80px height=100% empty min-height-large: 80x150 child=75
grid inline-block width=80px height=100% empty max-height: 80x30 child=15
-grid inline-block width=80px height=100% empty min-width: 150x160 child=80
-grid inline-block width=80px height=100% empty max-width: 40x160 child=80
+grid inline-block width=80px height=100% empty min-width: 150x75 child=37.5
+grid inline-block width=80px height=100% empty max-width: 40x20 child=10
grid inline-block width=80px height=100% empty min-width-max-height: 150x30 child=15
grid inline-block width=80px height=100% empty max-width-min-height: 40x60 child=30
grid inline-block width=80px height=100% empty border-box-min-height: 80x60 child=25
-grid inline-block width=80px height=100% empty border-box-max-width: 40x170 child=80
+grid inline-block width=80px height=100% empty border-box-max-width: 40x20 child=5
grid inline-block width=80px height=100% tall min-height: 80x60 child=30
grid inline-block width=80px height=100% tall min-height-large: 80x150 child=75
grid inline-block width=80px height=100% tall max-height: 80x30 child=15
-grid inline-block width=80px height=100% tall min-width: 150x160 child=80
-grid inline-block width=80px height=100% tall max-width: 40x160 child=80
+grid inline-block width=80px height=100% tall min-width: 150x75 child=37.5
+grid inline-block width=80px height=100% tall max-width: 40x20 child=10
grid inline-block width=80px height=100% tall min-width-max-height: 150x30 child=15
grid inline-block width=80px height=100% tall max-width-min-height: 40x60 child=30
grid inline-block width=80px height=100% tall border-box-min-height: 80x60 child=25
-grid inline-block width=80px height=100% tall border-box-max-width: 40x170 child=80
+grid inline-block width=80px height=100% tall border-box-max-width: 40x20 child=5
grid inline-block width=80px height=40px empty min-height: 80x60 child=30
grid inline-block width=80px height=40px empty min-height-large: 80x150 child=75
grid inline-block width=80px height=40px empty max-height: 80x30 child=15
@@ -6137,7 +6137,7 @@ grid inline-block width=50% height=100% tall max-width-min-height: 40x60 child=3
grid inline-block width=50% height=100% tall border-box-min-height: 100x60 child=25
grid inline-block width=50% height=100% tall border-box-max-width: 40x20 child=5
grid inline-block width=50% height=40px empty min-height: 100x60 child=30
-grid inline-block width=50% height=40px empty min-height-large: 100x150 child=75
+grid inline-block width=50% height=40px empty min-height-large: 150x150 child=75
grid inline-block width=50% height=40px empty max-height: 100x30 child=15
grid inline-block width=50% height=40px empty min-width: 150x40 child=20
grid inline-block width=50% height=40px empty max-width: 40x40 child=20
@@ -6146,7 +6146,7 @@ grid inline-block width=50% height=40px empty max-width-min-height: 40x60 child=
grid inline-block width=50% height=40px empty border-box-min-height: 100x60 child=25
grid inline-block width=50% height=40px empty border-box-max-width: 40x40 child=15
grid inline-block width=50% height=40px tall min-height: 100x60 child=30
-grid inline-block width=50% height=40px tall min-height-large: 100x150 child=75
+grid inline-block width=50% height=40px tall min-height-large: 150x150 child=75
grid inline-block width=50% height=40px tall max-height: 100x30 child=15
grid inline-block width=50% height=40px tall min-width: 150x40 child=20
grid inline-block width=50% height=40px tall max-width: 40x40 child=20
@@ -6229,21 +6229,21 @@ grid float width=80px height=auto tall border-box-max-width: 40x315 child=152.5
grid float width=80px height=100% empty min-height: 80x60 child=30
grid float width=80px height=100% empty min-height-large: 80x150 child=75
grid float width=80px height=100% empty max-height: 80x30 child=15
-grid float width=80px height=100% empty min-width: 150x160 child=80
-grid float width=80px height=100% empty max-width: 40x160 child=80
+grid float width=80px height=100% empty min-width: 150x75 child=37.5
+grid float width=80px height=100% empty max-width: 40x20 child=10
grid float width=80px height=100% empty min-width-max-height: 150x30 child=15
grid float width=80px height=100% empty max-width-min-height: 40x60 child=30
grid float width=80px height=100% empty border-box-min-height: 80x60 child=25
-grid float width=80px height=100% empty border-box-max-width: 40x170 child=80
+grid float width=80px height=100% empty border-box-max-width: 40x20 child=5
grid float width=80px height=100% tall min-height: 80x60 child=30
grid float width=80px height=100% tall min-height-large: 80x150 child=75
grid float width=80px height=100% tall max-height: 80x30 child=15
-grid float width=80px height=100% tall min-width: 150x160 child=80
-grid float width=80px height=100% tall max-width: 40x160 child=80
+grid float width=80px height=100% tall min-width: 150x75 child=37.5
+grid float width=80px height=100% tall max-width: 40x20 child=10
grid float width=80px height=100% tall min-width-max-height: 150x30 child=15
grid float width=80px height=100% tall max-width-min-height: 40x60 child=30
grid float width=80px height=100% tall border-box-min-height: 80x60 child=25
-grid float width=80px height=100% tall border-box-max-width: 40x170 child=80
+grid float width=80px height=100% tall border-box-max-width: 40x20 child=5
grid float width=80px height=40px empty min-height: 80x60 child=30
grid float width=80px height=40px empty min-height-large: 80x150 child=75
grid float width=80px height=40px empty max-height: 80x30 child=15
@@ -6299,7 +6299,7 @@ grid float width=50% height=100% tall max-width-min-height: 40x60 child=30
grid float width=50% height=100% tall border-box-min-height: 100x60 child=25
grid float width=50% height=100% tall border-box-max-width: 40x20 child=5
grid float width=50% height=40px empty min-height: 100x60 child=30
-grid float width=50% height=40px empty min-height-large: 100x150 child=75
+grid float width=50% height=40px empty min-height-large: 150x150 child=75
grid float width=50% height=40px empty max-height: 100x30 child=15
grid float width=50% height=40px empty min-width: 150x40 child=20
grid float width=50% height=40px empty max-width: 40x40 child=20
@@ -6308,7 +6308,7 @@ grid float width=50% height=40px empty max-width-min-height: 40x60 child=30
grid float width=50% height=40px empty border-box-min-height: 100x60 child=25
grid float width=50% height=40px empty border-box-max-width: 40x40 child=15
grid float width=50% height=40px tall min-height: 100x60 child=30
-grid float width=50% height=40px tall min-height-large: 100x150 child=75
+grid float width=50% height=40px tall min-height-large: 150x150 child=75
grid float width=50% height=40px tall max-height: 100x30 child=15
grid float width=50% height=40px tall min-width: 150x40 child=20
grid float width=50% height=40px tall max-width: 40x40 child=20
@@ -6391,12 +6391,12 @@ grid flex width=80px height=auto tall border-box-max-width: 40x310 child=150
grid flex width=80px height=100% empty min-height: 80x60 child=30
grid flex width=80px height=100% empty min-height-large: 80x150 child=75
grid flex width=80px height=100% empty max-height: 80x30 child=15
-grid flex width=80px height=100% empty min-width: 150x160 child=80
-grid flex width=80px height=100% empty max-width: 40x160 child=80
+grid flex width=80px height=100% empty min-width: 150x75 child=37.5
+grid flex width=80px height=100% empty max-width: 40x20 child=10
grid flex width=80px height=100% empty min-width-max-height: 150x30 child=15
grid flex width=80px height=100% empty max-width-min-height: 40x60 child=30
grid flex width=80px height=100% empty border-box-min-height: 80x60 child=25
-grid flex width=80px height=100% empty border-box-max-width: 40x170 child=80
+grid flex width=80px height=100% empty border-box-max-width: 40x20 child=5
grid flex width=80px height=100% tall min-height: 80x300 child=150
grid flex width=80px height=100% tall min-height-large: 80x300 child=150
grid flex width=80px height=100% tall max-height: 80x30 child=15
@@ -6461,7 +6461,7 @@ grid flex width=50% height=100% tall max-width-min-height: 40x300 child=150
grid flex width=50% height=100% tall border-box-min-height: 100x310 child=150
grid flex width=50% height=100% tall border-box-max-width: 40x310 child=150
grid flex width=50% height=40px empty min-height: 100x60 child=30
-grid flex width=50% height=40px empty min-height-large: 100x150 child=75
+grid flex width=50% height=40px empty min-height-large: 150x150 child=75
grid flex width=50% height=40px empty max-height: 100x30 child=15
grid flex width=50% height=40px empty min-width: 150x40 child=20
grid flex width=50% height=40px empty max-width: 40x40 child=20
@@ -6470,7 +6470,7 @@ grid flex width=50% height=40px empty max-width-min-height: 40x60 child=30
grid flex width=50% height=40px empty border-box-min-height: 100x60 child=25
grid flex width=50% height=40px empty border-box-max-width: 40x40 child=15
grid flex width=50% height=40px tall min-height: 100x60 child=30
-grid flex width=50% height=40px tall min-height-large: 100x150 child=75
+grid flex width=50% height=40px tall min-height-large: 150x150 child=75
grid flex width=50% height=40px tall max-height: 100x30 child=15
grid flex width=50% height=40px tall min-width: 150x40 child=20
grid flex width=50% height=40px tall max-width: 40x40 child=20
@@ -6553,12 +6553,12 @@ grid grid width=80px height=auto tall border-box-max-width: 40x310 child=0
grid grid width=80px height=100% empty min-height: 80x60 child=30
grid grid width=80px height=100% empty min-height-large: 80x150 child=75
grid grid width=80px height=100% empty max-height: 80x30 child=15
-grid grid width=80px height=100% empty min-width: 150x160 child=80
-grid grid width=80px height=100% empty max-width: 40x160 child=80
+grid grid width=80px height=100% empty min-width: 150x75 child=37.5
+grid grid width=80px height=100% empty max-width: 40x20 child=10
grid grid width=80px height=100% empty min-width-max-height: 150x30 child=15
grid grid width=80px height=100% empty max-width-min-height: 40x60 child=30
grid grid width=80px height=100% empty border-box-min-height: 80x60 child=25
-grid grid width=80px height=100% empty border-box-max-width: 40x170 child=80
+grid grid width=80px height=100% empty border-box-max-width: 40x20 child=5
grid grid width=80px height=100% tall min-height: 80x300 child=0
grid grid width=80px height=100% tall min-height-large: 80x300 child=0
grid grid width=80px height=100% tall max-height: 80x30 child=0
@@ -6623,7 +6623,7 @@ grid grid width=50% height=100% tall max-width-min-height: 40x300 child=0
grid grid width=50% height=100% tall border-box-min-height: 100x310 child=0
grid grid width=50% height=100% tall border-box-max-width: 40x310 child=0
grid grid width=50% height=40px empty min-height: 100x60 child=30
-grid grid width=50% height=40px empty min-height-large: 100x150 child=75
+grid grid width=50% height=40px empty min-height-large: 150x150 child=75
grid grid width=50% height=40px empty max-height: 100x30 child=15
grid grid width=50% height=40px empty min-width: 150x40 child=20
grid grid width=50% height=40px empty max-width: 40x40 child=20
@@ -6632,7 +6632,7 @@ grid grid width=50% height=40px empty max-width-min-height: 40x60 child=30
grid grid width=50% height=40px empty border-box-min-height: 100x60 child=25
grid grid width=50% height=40px empty border-box-max-width: 40x40 child=15
grid grid width=50% height=40px tall min-height: 100x60 child=0
-grid grid width=50% height=40px tall min-height-large: 100x150 child=0
+grid grid width=50% height=40px tall min-height-large: 150x150 child=0
grid grid width=50% height=40px tall max-height: 100x30 child=0
grid grid width=50% height=40px tall min-width: 150x40 child=0
grid grid width=50% height=40px tall max-width: 40x40 child=0
@@ -6947,7 +6947,7 @@ grid-definite-row block width=50% height=100% tall max-width-min-height: 40x120
grid-definite-row block width=50% height=100% tall border-box-min-height: 100x120 child=55
grid-definite-row block width=50% height=100% tall border-box-max-width: 40x120 child=55
grid-definite-row block width=50% height=40px empty min-height: 100x60 child=30
-grid-definite-row block width=50% height=40px empty min-height-large: 100x150 child=75
+grid-definite-row block width=50% height=40px empty min-height-large: 150x150 child=75
grid-definite-row block width=50% height=40px empty max-height: 100x30 child=15
grid-definite-row block width=50% height=40px empty min-width: 150x40 child=20
grid-definite-row block width=50% height=40px empty max-width: 40x40 child=20
@@ -6956,7 +6956,7 @@ grid-definite-row block width=50% height=40px empty max-width-min-height: 40x60
grid-definite-row block width=50% height=40px empty border-box-min-height: 100x60 child=25
grid-definite-row block width=50% height=40px empty border-box-max-width: 40x40 child=15
grid-definite-row block width=50% height=40px tall min-height: 100x60 child=30
-grid-definite-row block width=50% height=40px tall min-height-large: 100x150 child=75
+grid-definite-row block width=50% height=40px tall min-height-large: 150x150 child=75
grid-definite-row block width=50% height=40px tall max-height: 100x30 child=15
grid-definite-row block width=50% height=40px tall min-width: 150x40 child=20
grid-definite-row block width=50% height=40px tall max-width: 40x40 child=20
@@ -7109,7 +7109,7 @@ grid-definite-row flow-root width=50% height=100% tall max-width-min-height: 40x
grid-definite-row flow-root width=50% height=100% tall border-box-min-height: 100x120 child=55
grid-definite-row flow-root width=50% height=100% tall border-box-max-width: 40x120 child=55
grid-definite-row flow-root width=50% height=40px empty min-height: 100x60 child=30
-grid-definite-row flow-root width=50% height=40px empty min-height-large: 100x150 child=75
+grid-definite-row flow-root width=50% height=40px empty min-height-large: 150x150 child=75
grid-definite-row flow-root width=50% height=40px empty max-height: 100x30 child=15
grid-definite-row flow-root width=50% height=40px empty min-width: 150x40 child=20
grid-definite-row flow-root width=50% height=40px empty max-width: 40x40 child=20
@@ -7118,7 +7118,7 @@ grid-definite-row flow-root width=50% height=40px empty max-width-min-height: 40
grid-definite-row flow-root width=50% height=40px empty border-box-min-height: 100x60 child=25
grid-definite-row flow-root width=50% height=40px empty border-box-max-width: 40x40 child=15
grid-definite-row flow-root width=50% height=40px tall min-height: 100x60 child=30
-grid-definite-row flow-root width=50% height=40px tall min-height-large: 100x150 child=75
+grid-definite-row flow-root width=50% height=40px tall min-height-large: 150x150 child=75
grid-definite-row flow-root width=50% height=40px tall max-height: 100x30 child=15
grid-definite-row flow-root width=50% height=40px tall min-width: 150x40 child=20
grid-definite-row flow-root width=50% height=40px tall max-width: 40x40 child=20
@@ -7271,7 +7271,7 @@ grid-definite-row inline-block width=50% height=100% tall max-width-min-height:
grid-definite-row inline-block width=50% height=100% tall border-box-min-height: 100x120 child=55
grid-definite-row inline-block width=50% height=100% tall border-box-max-width: 40x120 child=55
grid-definite-row inline-block width=50% height=40px empty min-height: 100x60 child=30
-grid-definite-row inline-block width=50% height=40px empty min-height-large: 100x150 child=75
+grid-definite-row inline-block width=50% height=40px empty min-height-large: 150x150 child=75
grid-definite-row inline-block width=50% height=40px empty max-height: 100x30 child=15
grid-definite-row inline-block width=50% height=40px empty min-width: 150x40 child=20
grid-definite-row inline-block width=50% height=40px empty max-width: 40x40 child=20
@@ -7280,7 +7280,7 @@ grid-definite-row inline-block width=50% height=40px empty max-width-min-height:
grid-definite-row inline-block width=50% height=40px empty border-box-min-height: 100x60 child=25
grid-definite-row inline-block width=50% height=40px empty border-box-max-width: 40x40 child=15
grid-definite-row inline-block width=50% height=40px tall min-height: 100x60 child=30
-grid-definite-row inline-block width=50% height=40px tall min-height-large: 100x150 child=75
+grid-definite-row inline-block width=50% height=40px tall min-height-large: 150x150 child=75
grid-definite-row inline-block width=50% height=40px tall max-height: 100x30 child=15
grid-definite-row inline-block width=50% height=40px tall min-width: 150x40 child=20
grid-definite-row inline-block width=50% height=40px tall max-width: 40x40 child=20
@@ -7433,7 +7433,7 @@ grid-definite-row float width=50% height=100% tall max-width-min-height: 40x120
grid-definite-row float width=50% height=100% tall border-box-min-height: 100x120 child=55
grid-definite-row float width=50% height=100% tall border-box-max-width: 40x120 child=55
grid-definite-row float width=50% height=40px empty min-height: 100x60 child=30
-grid-definite-row float width=50% height=40px empty min-height-large: 100x150 child=75
+grid-definite-row float width=50% height=40px empty min-height-large: 150x150 child=75
grid-definite-row float width=50% height=40px empty max-height: 100x30 child=15
grid-definite-row float width=50% height=40px empty min-width: 150x40 child=20
grid-definite-row float width=50% height=40px empty max-width: 40x40 child=20
@@ -7442,7 +7442,7 @@ grid-definite-row float width=50% height=40px empty max-width-min-height: 40x60
grid-definite-row float width=50% height=40px empty border-box-min-height: 100x60 child=25
grid-definite-row float width=50% height=40px empty border-box-max-width: 40x40 child=15
grid-definite-row float width=50% height=40px tall min-height: 100x60 child=30
-grid-definite-row float width=50% height=40px tall min-height-large: 100x150 child=75
+grid-definite-row float width=50% height=40px tall min-height-large: 150x150 child=75
grid-definite-row float width=50% height=40px tall max-height: 100x30 child=15
grid-definite-row float width=50% height=40px tall min-width: 150x40 child=20
grid-definite-row float width=50% height=40px tall max-width: 40x40 child=20
@@ -7595,7 +7595,7 @@ grid-definite-row flex width=50% height=100% tall max-width-min-height: 40x120 c
grid-definite-row flex width=50% height=100% tall border-box-min-height: 100x120 child=55
grid-definite-row flex width=50% height=100% tall border-box-max-width: 40x120 child=55
grid-definite-row flex width=50% height=40px empty min-height: 100x60 child=30
-grid-definite-row flex width=50% height=40px empty min-height-large: 100x150 child=75
+grid-definite-row flex width=50% height=40px empty min-height-large: 150x150 child=75
grid-definite-row flex width=50% height=40px empty max-height: 100x30 child=15
grid-definite-row flex width=50% height=40px empty min-width: 150x40 child=20
grid-definite-row flex width=50% height=40px empty max-width: 40x40 child=20
@@ -7604,7 +7604,7 @@ grid-definite-row flex width=50% height=40px empty max-width-min-height: 40x60 c
grid-definite-row flex width=50% height=40px empty border-box-min-height: 100x60 child=25
grid-definite-row flex width=50% height=40px empty border-box-max-width: 40x40 child=15
grid-definite-row flex width=50% height=40px tall min-height: 100x60 child=30
-grid-definite-row flex width=50% height=40px tall min-height-large: 100x150 child=75
+grid-definite-row flex width=50% height=40px tall min-height-large: 150x150 child=75
grid-definite-row flex width=50% height=40px tall max-height: 100x30 child=15
grid-definite-row flex width=50% height=40px tall min-width: 150x40 child=20
grid-definite-row flex width=50% height=40px tall max-width: 40x40 child=20
@@ -7757,7 +7757,7 @@ grid-definite-row grid width=50% height=100% tall max-width-min-height: 40x120 c
grid-definite-row grid width=50% height=100% tall border-box-min-height: 100x120 child=0
grid-definite-row grid width=50% height=100% tall border-box-max-width: 40x120 child=0
grid-definite-row grid width=50% height=40px empty min-height: 100x60 child=30
-grid-definite-row grid width=50% height=40px empty min-height-large: 100x150 child=75
+grid-definite-row grid width=50% height=40px empty min-height-large: 150x150 child=75
grid-definite-row grid width=50% height=40px empty max-height: 100x30 child=15
grid-definite-row grid width=50% height=40px empty min-width: 150x40 child=20
grid-definite-row grid width=50% height=40px empty max-width: 40x40 child=20
@@ -7766,7 +7766,7 @@ grid-definite-row grid width=50% height=40px empty max-width-min-height: 40x60 c
grid-definite-row grid width=50% height=40px empty border-box-min-height: 100x60 child=25
grid-definite-row grid width=50% height=40px empty border-box-max-width: 40x40 child=15
grid-definite-row grid width=50% height=40px tall min-height: 100x60 child=0
-grid-definite-row grid width=50% height=40px tall min-height-large: 100x150 child=0
+grid-definite-row grid width=50% height=40px tall min-height-large: 150x150 child=0
grid-definite-row grid width=50% height=40px tall max-height: 100x30 child=0
grid-definite-row grid width=50% height=40px tall min-width: 150x40 child=0
grid-definite-row grid width=50% height=40px tall max-width: 40x40 child=0
diff --git a/Tests/LibWeb/Text/expected/css/aspect-ratio-percentage-height-matrix.txt b/Tests/LibWeb/Text/expected/css/aspect-ratio-percentage-height-matrix.txt
index 2e02fd3ea79..933752cbcad 100644
--- a/Tests/LibWeb/Text/expected/css/aspect-ratio-percentage-height-matrix.txt
+++ b/Tests/LibWeb/Text/expected/css/aspect-ratio-percentage-height-matrix.txt
@@ -2542,22 +2542,22 @@ grid block width=auto height=auto tall none: 10x302.5 child=151.25
grid block width=auto height=auto tall max-height: 10x30 child=15
grid block width=auto height=auto tall min-height: 120x60 child=30
grid block width=auto height=auto tall padding: 20x310 child=150
-grid block width=80px height=100% empty none: 80x160 child=80
+grid block width=80px height=100% empty none: 80x40 child=20
grid block width=80px height=100% empty max-height: 80x30 child=15
grid block width=80px height=100% empty min-height: 80x60 child=30
-grid block width=80px height=100% empty padding: 80x170 child=80
-grid block width=80px height=100% tall none: 80x160 child=80
+grid block width=80px height=100% empty padding: 80x40 child=15
+grid block width=80px height=100% tall none: 80x40 child=20
grid block width=80px height=100% tall max-height: 80x30 child=15
grid block width=80px height=100% tall min-height: 80x60 child=30
-grid block width=80px height=100% tall padding: 80x170 child=80
-grid block width=80px height=calc empty none: 80x90 child=45
+grid block width=80px height=100% tall padding: 80x40 child=15
+grid block width=80px height=calc empty none: 80x30 child=15
grid block width=80px height=calc empty max-height: 80x25 child=12.5
grid block width=80px height=calc empty min-height: 80x60 child=30
-grid block width=80px height=calc empty padding: 80x95 child=42.5
-grid block width=80px height=calc tall none: 80x90 child=45
+grid block width=80px height=calc empty padding: 80x30 child=10
+grid block width=80px height=calc tall none: 80x30 child=15
grid block width=80px height=calc tall max-height: 80x25 child=12.5
grid block width=80px height=calc tall min-height: 80x60 child=30
-grid block width=80px height=calc tall padding: 80x95 child=42.5
+grid block width=80px height=calc tall padding: 80x30 child=10
grid block width=80px height=auto empty none: 80x40 child=20
grid block width=80px height=auto empty max-height: 80x30 child=15
grid block width=80px height=auto empty min-height: 80x60 child=30
@@ -2614,22 +2614,22 @@ grid flow-root width=auto height=auto tall none: 10x302.5 child=151.25
grid flow-root width=auto height=auto tall max-height: 10x30 child=15
grid flow-root width=auto height=auto tall min-height: 120x60 child=30
grid flow-root width=auto height=auto tall padding: 20x310 child=150
-grid flow-root width=80px height=100% empty none: 80x160 child=80
+grid flow-root width=80px height=100% empty none: 80x40 child=20
grid flow-root width=80px height=100% empty max-height: 80x30 child=15
grid flow-root width=80px height=100% empty min-height: 80x60 child=30
-grid flow-root width=80px height=100% empty padding: 80x170 child=80
-grid flow-root width=80px height=100% tall none: 80x160 child=80
+grid flow-root width=80px height=100% empty padding: 80x40 child=15
+grid flow-root width=80px height=100% tall none: 80x40 child=20
grid flow-root width=80px height=100% tall max-height: 80x30 child=15
grid flow-root width=80px height=100% tall min-height: 80x60 child=30
-grid flow-root width=80px height=100% tall padding: 80x170 child=80
-grid flow-root width=80px height=calc empty none: 80x90 child=45
+grid flow-root width=80px height=100% tall padding: 80x40 child=15
+grid flow-root width=80px height=calc empty none: 80x30 child=15
grid flow-root width=80px height=calc empty max-height: 80x25 child=12.5
grid flow-root width=80px height=calc empty min-height: 80x60 child=30
-grid flow-root width=80px height=calc empty padding: 80x95 child=42.5
-grid flow-root width=80px height=calc tall none: 80x90 child=45
+grid flow-root width=80px height=calc empty padding: 80x30 child=10
+grid flow-root width=80px height=calc tall none: 80x30 child=15
grid flow-root width=80px height=calc tall max-height: 80x25 child=12.5
grid flow-root width=80px height=calc tall min-height: 80x60 child=30
-grid flow-root width=80px height=calc tall padding: 80x95 child=42.5
+grid flow-root width=80px height=calc tall padding: 80x30 child=10
grid flow-root width=80px height=auto empty none: 80x40 child=20
grid flow-root width=80px height=auto empty max-height: 80x30 child=15
grid flow-root width=80px height=auto empty min-height: 80x60 child=30
@@ -2686,22 +2686,22 @@ grid inline-block width=auto height=auto tall none: 10x302.5 child=151.25
grid inline-block width=auto height=auto tall max-height: 10x30 child=15
grid inline-block width=auto height=auto tall min-height: 120x60 child=30
grid inline-block width=auto height=auto tall padding: 20x310 child=150
-grid inline-block width=80px height=100% empty none: 80x160 child=80
+grid inline-block width=80px height=100% empty none: 80x40 child=20
grid inline-block width=80px height=100% empty max-height: 80x30 child=15
grid inline-block width=80px height=100% empty min-height: 80x60 child=30
-grid inline-block width=80px height=100% empty padding: 80x170 child=80
-grid inline-block width=80px height=100% tall none: 80x160 child=80
+grid inline-block width=80px height=100% empty padding: 80x40 child=15
+grid inline-block width=80px height=100% tall none: 80x40 child=20
grid inline-block width=80px height=100% tall max-height: 80x30 child=15
grid inline-block width=80px height=100% tall min-height: 80x60 child=30
-grid inline-block width=80px height=100% tall padding: 80x170 child=80
-grid inline-block width=80px height=calc empty none: 80x90 child=45
+grid inline-block width=80px height=100% tall padding: 80x40 child=15
+grid inline-block width=80px height=calc empty none: 80x30 child=15
grid inline-block width=80px height=calc empty max-height: 80x25 child=12.5
grid inline-block width=80px height=calc empty min-height: 80x60 child=30
-grid inline-block width=80px height=calc empty padding: 80x95 child=42.5
-grid inline-block width=80px height=calc tall none: 80x90 child=45
+grid inline-block width=80px height=calc empty padding: 80x30 child=10
+grid inline-block width=80px height=calc tall none: 80x30 child=15
grid inline-block width=80px height=calc tall max-height: 80x25 child=12.5
grid inline-block width=80px height=calc tall min-height: 80x60 child=30
-grid inline-block width=80px height=calc tall padding: 80x95 child=42.5
+grid inline-block width=80px height=calc tall padding: 80x30 child=10
grid inline-block width=80px height=auto empty none: 80x40 child=20
grid inline-block width=80px height=auto empty max-height: 80x30 child=15
grid inline-block width=80px height=auto empty min-height: 80x60 child=30
@@ -2758,22 +2758,22 @@ grid float width=auto height=auto tall none: 10x302.5 child=151.25
grid float width=auto height=auto tall max-height: 10x30 child=15
grid float width=auto height=auto tall min-height: 120x60 child=30
grid float width=auto height=auto tall padding: 20x310 child=150
-grid float width=80px height=100% empty none: 80x160 child=80
+grid float width=80px height=100% empty none: 80x40 child=20
grid float width=80px height=100% empty max-height: 80x30 child=15
grid float width=80px height=100% empty min-height: 80x60 child=30
-grid float width=80px height=100% empty padding: 80x170 child=80
-grid float width=80px height=100% tall none: 80x160 child=80
+grid float width=80px height=100% empty padding: 80x40 child=15
+grid float width=80px height=100% tall none: 80x40 child=20
grid float width=80px height=100% tall max-height: 80x30 child=15
grid float width=80px height=100% tall min-height: 80x60 child=30
-grid float width=80px height=100% tall padding: 80x170 child=80
-grid float width=80px height=calc empty none: 80x90 child=45
+grid float width=80px height=100% tall padding: 80x40 child=15
+grid float width=80px height=calc empty none: 80x30 child=15
grid float width=80px height=calc empty max-height: 80x25 child=12.5
grid float width=80px height=calc empty min-height: 80x60 child=30
-grid float width=80px height=calc empty padding: 80x95 child=42.5
-grid float width=80px height=calc tall none: 80x90 child=45
+grid float width=80px height=calc empty padding: 80x30 child=10
+grid float width=80px height=calc tall none: 80x30 child=15
grid float width=80px height=calc tall max-height: 80x25 child=12.5
grid float width=80px height=calc tall min-height: 80x60 child=30
-grid float width=80px height=calc tall padding: 80x95 child=42.5
+grid float width=80px height=calc tall padding: 80x30 child=10
grid float width=80px height=auto empty none: 80x40 child=20
grid float width=80px height=auto empty max-height: 80x30 child=15
grid float width=80px height=auto empty min-height: 80x60 child=30
@@ -2830,18 +2830,18 @@ grid flex width=auto height=auto tall none: 10x300 child=150
grid flex width=auto height=auto tall max-height: 10x30 child=15
grid flex width=auto height=auto tall min-height: 120x60 child=30
grid flex width=auto height=auto tall padding: 20x310 child=150
-grid flex width=80px height=100% empty none: 80x160 child=80
+grid flex width=80px height=100% empty none: 80x40 child=20
grid flex width=80px height=100% empty max-height: 80x30 child=15
grid flex width=80px height=100% empty min-height: 80x60 child=30
-grid flex width=80px height=100% empty padding: 80x170 child=80
+grid flex width=80px height=100% empty padding: 80x40 child=15
grid flex width=80px height=100% tall none: 80x300 child=150
grid flex width=80px height=100% tall max-height: 80x30 child=15
grid flex width=80px height=100% tall min-height: 80x300 child=150
grid flex width=80px height=100% tall padding: 80x310 child=150
-grid flex width=80px height=calc empty none: 80x90 child=45
+grid flex width=80px height=calc empty none: 80x30 child=15
grid flex width=80px height=calc empty max-height: 80x25 child=12.5
grid flex width=80px height=calc empty min-height: 80x60 child=30
-grid flex width=80px height=calc empty padding: 80x95 child=42.5
+grid flex width=80px height=calc empty padding: 80x30 child=10
grid flex width=80px height=calc tall none: 80x160 child=80
grid flex width=80px height=calc tall max-height: 80x25 child=12.5
grid flex width=80px height=calc tall min-height: 80x160 child=80
@@ -2902,18 +2902,18 @@ grid grid width=auto height=auto tall none: 10x300 child=0
grid grid width=auto height=auto tall max-height: 10x30 child=0
grid grid width=auto height=auto tall min-height: 120x60 child=0
grid grid width=auto height=auto tall padding: 20x310 child=0
-grid grid width=80px height=100% empty none: 80x160 child=80
+grid grid width=80px height=100% empty none: 80x40 child=20
grid grid width=80px height=100% empty max-height: 80x30 child=15
grid grid width=80px height=100% empty min-height: 80x60 child=30
-grid grid width=80px height=100% empty padding: 80x170 child=80
+grid grid width=80px height=100% empty padding: 80x40 child=15
grid grid width=80px height=100% tall none: 80x300 child=0
grid grid width=80px height=100% tall max-height: 80x30 child=0
grid grid width=80px height=100% tall min-height: 80x300 child=0
grid grid width=80px height=100% tall padding: 80x310 child=0
-grid grid width=80px height=calc empty none: 80x90 child=45
+grid grid width=80px height=calc empty none: 80x30 child=15
grid grid width=80px height=calc empty max-height: 80x25 child=12.5
grid grid width=80px height=calc empty min-height: 80x60 child=30
-grid grid width=80px height=calc empty padding: 80x95 child=42.5
+grid grid width=80px height=calc empty padding: 80x30 child=10
grid grid width=80px height=calc tall none: 80x160 child=0
grid grid width=80px height=calc tall max-height: 80x25 child=0
grid grid width=80px height=calc tall min-height: 80x160 child=0