Skip to content

Truly independent web browser

LibWeb: Treat column flex item aspect-ratio heights as definite

Andreas Kling59a5d8bfc82d
diff --git a/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs
index 0a6b77d7550..9c4cc642b60 100644
--- a/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs
@@ -1618,9 +1618,16 @@ impl<'pass> FlexFormattingContext<'pass> {
!= self.inline_axis_is_horizontal(self.run.box_);
let container_has_vertical_inline_main_axis =
self.is_row_layout() && !self.inline_axis_is_horizontal(self.run.box_);
+ // INTEROP: The block size of a non-replaced item with an aspect ratio follows from its inline size, so other
+ // engines treat its post-flexing main size as definite when the main axis is its block axis.
+ let node = self.flex_items[index].box_;
+ let aspect_ratio_provides_block_main_size = !self.main_axis_is_parallel_to_inline_axis(node)
+ && !self.facts(node).is_replaced_box()
+ && self.facts(node).has_preferred_aspect_ratio();
if self.has_definite_main_size_used(self.container_used())
|| self.flex_items[index].used_flex_basis_is_definite
|| self.flex_items[index].main_size_was_resolved_from_aspect_ratio
+ || aspect_ratio_provides_block_main_size
|| container_has_vertical_inline_main_axis
|| (item_is_orthogonal && self.main_axis_is_parallel_to_inline_axis(self.flex_items[index].box_))
{
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 c1972e2eeb3..07f94ead6a6 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
@@ -4534,41 +4534,41 @@ flex-row-stretch abspos width=50% height=40px tall min-width-max-height: 150x30
flex-row-stretch abspos width=50% height=40px tall max-width-min-height: 40x60 child=30
flex-row-stretch abspos width=50% height=40px tall border-box-min-height: 100x60 child=25
flex-row-stretch abspos width=50% height=40px tall border-box-max-width: 40x40 child=15
-flex-column block width=auto height=auto empty min-height: 120x60 child=0
-flex-column block width=auto height=auto empty min-height-large: 300x150 child=0
+flex-column block width=auto height=auto empty min-height: 120x60 child=30
+flex-column block width=auto height=auto empty min-height-large: 300x150 child=75
flex-column block width=auto height=auto empty max-height: 0x0 child=0
-flex-column block width=auto height=auto empty min-width: 150x75 child=0
+flex-column block width=auto height=auto empty min-width: 150x75 child=37.5
flex-column block width=auto height=auto empty max-width: 0x0 child=0
-flex-column block width=auto height=auto empty min-width-max-height: 150x30 child=0
-flex-column block width=auto height=auto empty max-width-min-height: 40x60 child=0
-flex-column block width=auto height=auto empty border-box-min-height: 120x60 child=0
+flex-column block width=auto height=auto empty min-width-max-height: 150x30 child=15
+flex-column block width=auto height=auto empty max-width-min-height: 40x60 child=30
+flex-column block width=auto height=auto empty border-box-min-height: 120x60 child=25
flex-column block width=auto height=auto empty border-box-max-width: 20x10 child=0
-flex-column block width=auto height=auto tall min-height: 120x60 child=0
-flex-column block width=auto height=auto tall min-height-large: 300x150 child=0
-flex-column block width=auto height=auto tall max-height: 60x30 child=0
-flex-column block width=auto height=auto tall min-width: 675x337.5 child=0
-flex-column block width=auto height=auto tall max-width: 40x20 child=0
-flex-column block width=auto height=auto tall min-width-max-height: 150x30 child=0
-flex-column block width=auto height=auto tall max-width-min-height: 40x60 child=0
-flex-column block width=auto height=auto tall border-box-min-height: 120x60 child=0
-flex-column block width=auto height=auto tall border-box-max-width: 40x20 child=0
-flex-column block width=auto height=100% empty min-height: 120x60 child=0
-flex-column block width=auto height=100% empty min-height-large: 300x150 child=0
+flex-column block width=auto height=auto tall min-height: 120x60 child=30
+flex-column block width=auto height=auto tall min-height-large: 300x150 child=75
+flex-column block width=auto height=auto tall max-height: 60x30 child=15
+flex-column block width=auto height=auto tall min-width: 675x337.5 child=168.75
+flex-column block width=auto height=auto tall max-width: 40x20 child=10
+flex-column block width=auto height=auto tall min-width-max-height: 150x30 child=15
+flex-column block width=auto height=auto tall max-width-min-height: 40x60 child=30
+flex-column block width=auto height=auto tall border-box-min-height: 120x60 child=25
+flex-column block width=auto height=auto tall border-box-max-width: 40x20 child=5
+flex-column block width=auto height=100% empty min-height: 120x60 child=30
+flex-column block width=auto height=100% empty min-height-large: 300x150 child=75
flex-column block width=auto height=100% empty max-height: 0x0 child=0
-flex-column block width=auto height=100% empty min-width: 150x75 child=0
+flex-column block width=auto height=100% empty min-width: 150x75 child=37.5
flex-column block width=auto height=100% empty max-width: 0x0 child=0
-flex-column block width=auto height=100% empty min-width-max-height: 150x30 child=0
-flex-column block width=auto height=100% empty max-width-min-height: 40x60 child=0
-flex-column block width=auto height=100% empty border-box-min-height: 120x60 child=0
+flex-column block width=auto height=100% empty min-width-max-height: 150x30 child=15
+flex-column block width=auto height=100% empty max-width-min-height: 40x60 child=30
+flex-column block width=auto height=100% empty border-box-min-height: 120x60 child=25
flex-column block width=auto height=100% empty border-box-max-width: 20x10 child=0
-flex-column block width=auto height=100% tall min-height: 120x60 child=0
-flex-column block width=auto height=100% tall min-height-large: 300x150 child=0
-flex-column block width=auto height=100% tall max-height: 10x5 child=0
-flex-column block width=auto height=100% tall min-width: 150x75 child=0
-flex-column block width=auto height=100% tall max-width: 10x5 child=0
-flex-column block width=auto height=100% tall min-width-max-height: 150x30 child=0
-flex-column block width=auto height=100% tall max-width-min-height: 40x60 child=0
-flex-column block width=auto height=100% tall border-box-min-height: 120x60 child=0
+flex-column block width=auto height=100% tall min-height: 120x60 child=30
+flex-column block width=auto height=100% tall min-height-large: 300x150 child=75
+flex-column block width=auto height=100% tall max-height: 10x5 child=2.5
+flex-column block width=auto height=100% tall min-width: 150x75 child=37.5
+flex-column block width=auto height=100% tall max-width: 10x5 child=2.5
+flex-column block width=auto height=100% tall min-width-max-height: 150x30 child=15
+flex-column block width=auto height=100% tall max-width-min-height: 40x60 child=30
+flex-column block width=auto height=100% tall border-box-min-height: 120x60 child=25
flex-column block width=auto height=100% tall border-box-max-width: 20x10 child=0
flex-column block width=auto height=40px empty min-height: 120x60 child=30
flex-column block width=auto height=40px empty min-height-large: 300x150 child=75
@@ -4696,41 +4696,41 @@ flex-column block width=50% height=40px tall min-width-max-height: 150x30 child=
flex-column block width=50% height=40px tall max-width-min-height: 40x60 child=30
flex-column block width=50% height=40px tall border-box-min-height: 100x60 child=25
flex-column block width=50% height=40px tall border-box-max-width: 40x40 child=15
-flex-column flow-root width=auto height=auto empty min-height: 120x60 child=0
-flex-column flow-root width=auto height=auto empty min-height-large: 300x150 child=0
+flex-column flow-root width=auto height=auto empty min-height: 120x60 child=30
+flex-column flow-root width=auto height=auto empty min-height-large: 300x150 child=75
flex-column flow-root width=auto height=auto empty max-height: 0x0 child=0
-flex-column flow-root width=auto height=auto empty min-width: 150x75 child=0
+flex-column flow-root width=auto height=auto empty min-width: 150x75 child=37.5
flex-column flow-root width=auto height=auto empty max-width: 0x0 child=0
-flex-column flow-root width=auto height=auto empty min-width-max-height: 150x30 child=0
-flex-column flow-root width=auto height=auto empty max-width-min-height: 40x60 child=0
-flex-column flow-root width=auto height=auto empty border-box-min-height: 120x60 child=0
+flex-column flow-root width=auto height=auto empty min-width-max-height: 150x30 child=15
+flex-column flow-root width=auto height=auto empty max-width-min-height: 40x60 child=30
+flex-column flow-root width=auto height=auto empty border-box-min-height: 120x60 child=25
flex-column flow-root width=auto height=auto empty border-box-max-width: 20x10 child=0
-flex-column flow-root width=auto height=auto tall min-height: 120x60 child=0
-flex-column flow-root width=auto height=auto tall min-height-large: 300x150 child=0
-flex-column flow-root width=auto height=auto tall max-height: 60x30 child=0
-flex-column flow-root width=auto height=auto tall min-width: 675x337.5 child=0
-flex-column flow-root width=auto height=auto tall max-width: 40x20 child=0
-flex-column flow-root width=auto height=auto tall min-width-max-height: 150x30 child=0
-flex-column flow-root width=auto height=auto tall max-width-min-height: 40x60 child=0
-flex-column flow-root width=auto height=auto tall border-box-min-height: 120x60 child=0
-flex-column flow-root width=auto height=auto tall border-box-max-width: 40x20 child=0
-flex-column flow-root width=auto height=100% empty min-height: 120x60 child=0
-flex-column flow-root width=auto height=100% empty min-height-large: 300x150 child=0
+flex-column flow-root width=auto height=auto tall min-height: 120x60 child=30
+flex-column flow-root width=auto height=auto tall min-height-large: 300x150 child=75
+flex-column flow-root width=auto height=auto tall max-height: 60x30 child=15
+flex-column flow-root width=auto height=auto tall min-width: 675x337.5 child=168.75
+flex-column flow-root width=auto height=auto tall max-width: 40x20 child=10
+flex-column flow-root width=auto height=auto tall min-width-max-height: 150x30 child=15
+flex-column flow-root width=auto height=auto tall max-width-min-height: 40x60 child=30
+flex-column flow-root width=auto height=auto tall border-box-min-height: 120x60 child=25
+flex-column flow-root width=auto height=auto tall border-box-max-width: 40x20 child=5
+flex-column flow-root width=auto height=100% empty min-height: 120x60 child=30
+flex-column flow-root width=auto height=100% empty min-height-large: 300x150 child=75
flex-column flow-root width=auto height=100% empty max-height: 0x0 child=0
-flex-column flow-root width=auto height=100% empty min-width: 150x75 child=0
+flex-column flow-root width=auto height=100% empty min-width: 150x75 child=37.5
flex-column flow-root width=auto height=100% empty max-width: 0x0 child=0
-flex-column flow-root width=auto height=100% empty min-width-max-height: 150x30 child=0
-flex-column flow-root width=auto height=100% empty max-width-min-height: 40x60 child=0
-flex-column flow-root width=auto height=100% empty border-box-min-height: 120x60 child=0
+flex-column flow-root width=auto height=100% empty min-width-max-height: 150x30 child=15
+flex-column flow-root width=auto height=100% empty max-width-min-height: 40x60 child=30
+flex-column flow-root width=auto height=100% empty border-box-min-height: 120x60 child=25
flex-column flow-root width=auto height=100% empty border-box-max-width: 20x10 child=0
-flex-column flow-root width=auto height=100% tall min-height: 120x60 child=0
-flex-column flow-root width=auto height=100% tall min-height-large: 300x150 child=0
-flex-column flow-root width=auto height=100% tall max-height: 10x5 child=0
-flex-column flow-root width=auto height=100% tall min-width: 150x75 child=0
-flex-column flow-root width=auto height=100% tall max-width: 10x5 child=0
-flex-column flow-root width=auto height=100% tall min-width-max-height: 150x30 child=0
-flex-column flow-root width=auto height=100% tall max-width-min-height: 40x60 child=0
-flex-column flow-root width=auto height=100% tall border-box-min-height: 120x60 child=0
+flex-column flow-root width=auto height=100% tall min-height: 120x60 child=30
+flex-column flow-root width=auto height=100% tall min-height-large: 300x150 child=75
+flex-column flow-root width=auto height=100% tall max-height: 10x5 child=2.5
+flex-column flow-root width=auto height=100% tall min-width: 150x75 child=37.5
+flex-column flow-root width=auto height=100% tall max-width: 10x5 child=2.5
+flex-column flow-root width=auto height=100% tall min-width-max-height: 150x30 child=15
+flex-column flow-root width=auto height=100% tall max-width-min-height: 40x60 child=30
+flex-column flow-root width=auto height=100% tall border-box-min-height: 120x60 child=25
flex-column flow-root width=auto height=100% tall border-box-max-width: 20x10 child=0
flex-column flow-root width=auto height=40px empty min-height: 120x60 child=30
flex-column flow-root width=auto height=40px empty min-height-large: 300x150 child=75
@@ -4858,41 +4858,41 @@ flex-column flow-root width=50% height=40px tall min-width-max-height: 150x30 ch
flex-column flow-root width=50% height=40px tall max-width-min-height: 40x60 child=30
flex-column flow-root width=50% height=40px tall border-box-min-height: 100x60 child=25
flex-column flow-root width=50% height=40px tall border-box-max-width: 40x40 child=15
-flex-column inline-block width=auto height=auto empty min-height: 120x60 child=0
-flex-column inline-block width=auto height=auto empty min-height-large: 300x150 child=0
+flex-column inline-block width=auto height=auto empty min-height: 120x60 child=30
+flex-column inline-block width=auto height=auto empty min-height-large: 300x150 child=75
flex-column inline-block width=auto height=auto empty max-height: 0x0 child=0
-flex-column inline-block width=auto height=auto empty min-width: 150x75 child=0
+flex-column inline-block width=auto height=auto empty min-width: 150x75 child=37.5
flex-column inline-block width=auto height=auto empty max-width: 0x0 child=0
-flex-column inline-block width=auto height=auto empty min-width-max-height: 150x30 child=0
-flex-column inline-block width=auto height=auto empty max-width-min-height: 40x60 child=0
-flex-column inline-block width=auto height=auto empty border-box-min-height: 120x60 child=0
+flex-column inline-block width=auto height=auto empty min-width-max-height: 150x30 child=15
+flex-column inline-block width=auto height=auto empty max-width-min-height: 40x60 child=30
+flex-column inline-block width=auto height=auto empty border-box-min-height: 120x60 child=25
flex-column inline-block width=auto height=auto empty border-box-max-width: 20x10 child=0
-flex-column inline-block width=auto height=auto tall min-height: 120x60 child=0
-flex-column inline-block width=auto height=auto tall min-height-large: 300x150 child=0
-flex-column inline-block width=auto height=auto tall max-height: 60x30 child=0
-flex-column inline-block width=auto height=auto tall min-width: 675x337.5 child=0
-flex-column inline-block width=auto height=auto tall max-width: 40x20 child=0
-flex-column inline-block width=auto height=auto tall min-width-max-height: 150x30 child=0
-flex-column inline-block width=auto height=auto tall max-width-min-height: 40x60 child=0
-flex-column inline-block width=auto height=auto tall border-box-min-height: 120x60 child=0
-flex-column inline-block width=auto height=auto tall border-box-max-width: 40x20 child=0
-flex-column inline-block width=auto height=100% empty min-height: 120x60 child=0
-flex-column inline-block width=auto height=100% empty min-height-large: 300x150 child=0
+flex-column inline-block width=auto height=auto tall min-height: 120x60 child=30
+flex-column inline-block width=auto height=auto tall min-height-large: 300x150 child=75
+flex-column inline-block width=auto height=auto tall max-height: 60x30 child=15
+flex-column inline-block width=auto height=auto tall min-width: 675x337.5 child=168.75
+flex-column inline-block width=auto height=auto tall max-width: 40x20 child=10
+flex-column inline-block width=auto height=auto tall min-width-max-height: 150x30 child=15
+flex-column inline-block width=auto height=auto tall max-width-min-height: 40x60 child=30
+flex-column inline-block width=auto height=auto tall border-box-min-height: 120x60 child=25
+flex-column inline-block width=auto height=auto tall border-box-max-width: 40x20 child=5
+flex-column inline-block width=auto height=100% empty min-height: 120x60 child=30
+flex-column inline-block width=auto height=100% empty min-height-large: 300x150 child=75
flex-column inline-block width=auto height=100% empty max-height: 0x0 child=0
-flex-column inline-block width=auto height=100% empty min-width: 150x75 child=0
+flex-column inline-block width=auto height=100% empty min-width: 150x75 child=37.5
flex-column inline-block width=auto height=100% empty max-width: 0x0 child=0
-flex-column inline-block width=auto height=100% empty min-width-max-height: 150x30 child=0
-flex-column inline-block width=auto height=100% empty max-width-min-height: 40x60 child=0
-flex-column inline-block width=auto height=100% empty border-box-min-height: 120x60 child=0
+flex-column inline-block width=auto height=100% empty min-width-max-height: 150x30 child=15
+flex-column inline-block width=auto height=100% empty max-width-min-height: 40x60 child=30
+flex-column inline-block width=auto height=100% empty border-box-min-height: 120x60 child=25
flex-column inline-block width=auto height=100% empty border-box-max-width: 20x10 child=0
-flex-column inline-block width=auto height=100% tall min-height: 120x60 child=0
-flex-column inline-block width=auto height=100% tall min-height-large: 300x150 child=0
-flex-column inline-block width=auto height=100% tall max-height: 10x5 child=0
-flex-column inline-block width=auto height=100% tall min-width: 150x75 child=0
-flex-column inline-block width=auto height=100% tall max-width: 10x5 child=0
-flex-column inline-block width=auto height=100% tall min-width-max-height: 150x30 child=0
-flex-column inline-block width=auto height=100% tall max-width-min-height: 40x60 child=0
-flex-column inline-block width=auto height=100% tall border-box-min-height: 120x60 child=0
+flex-column inline-block width=auto height=100% tall min-height: 120x60 child=30
+flex-column inline-block width=auto height=100% tall min-height-large: 300x150 child=75
+flex-column inline-block width=auto height=100% tall max-height: 10x5 child=2.5
+flex-column inline-block width=auto height=100% tall min-width: 150x75 child=37.5
+flex-column inline-block width=auto height=100% tall max-width: 10x5 child=2.5
+flex-column inline-block width=auto height=100% tall min-width-max-height: 150x30 child=15
+flex-column inline-block width=auto height=100% tall max-width-min-height: 40x60 child=30
+flex-column inline-block width=auto height=100% tall border-box-min-height: 120x60 child=25
flex-column inline-block width=auto height=100% tall border-box-max-width: 20x10 child=0
flex-column inline-block width=auto height=40px empty min-height: 120x60 child=30
flex-column inline-block width=auto height=40px empty min-height-large: 300x150 child=75
@@ -5020,41 +5020,41 @@ flex-column inline-block width=50% height=40px tall min-width-max-height: 150x30
flex-column inline-block width=50% height=40px tall max-width-min-height: 40x60 child=30
flex-column inline-block width=50% height=40px tall border-box-min-height: 100x60 child=25
flex-column inline-block width=50% height=40px tall border-box-max-width: 40x40 child=15
-flex-column float width=auto height=auto empty min-height: 120x60 child=0
-flex-column float width=auto height=auto empty min-height-large: 300x150 child=0
+flex-column float width=auto height=auto empty min-height: 120x60 child=30
+flex-column float width=auto height=auto empty min-height-large: 300x150 child=75
flex-column float width=auto height=auto empty max-height: 0x0 child=0
-flex-column float width=auto height=auto empty min-width: 150x75 child=0
+flex-column float width=auto height=auto empty min-width: 150x75 child=37.5
flex-column float width=auto height=auto empty max-width: 0x0 child=0
-flex-column float width=auto height=auto empty min-width-max-height: 150x30 child=0
-flex-column float width=auto height=auto empty max-width-min-height: 40x60 child=0
-flex-column float width=auto height=auto empty border-box-min-height: 120x60 child=0
+flex-column float width=auto height=auto empty min-width-max-height: 150x30 child=15
+flex-column float width=auto height=auto empty max-width-min-height: 40x60 child=30
+flex-column float width=auto height=auto empty border-box-min-height: 120x60 child=25
flex-column float width=auto height=auto empty border-box-max-width: 20x10 child=0
-flex-column float width=auto height=auto tall min-height: 120x60 child=0
-flex-column float width=auto height=auto tall min-height-large: 300x150 child=0
-flex-column float width=auto height=auto tall max-height: 60x30 child=0
-flex-column float width=auto height=auto tall min-width: 675x337.5 child=0
-flex-column float width=auto height=auto tall max-width: 40x20 child=0
-flex-column float width=auto height=auto tall min-width-max-height: 150x30 child=0
-flex-column float width=auto height=auto tall max-width-min-height: 40x60 child=0
-flex-column float width=auto height=auto tall border-box-min-height: 120x60 child=0
-flex-column float width=auto height=auto tall border-box-max-width: 40x20 child=0
-flex-column float width=auto height=100% empty min-height: 120x60 child=0
-flex-column float width=auto height=100% empty min-height-large: 300x150 child=0
+flex-column float width=auto height=auto tall min-height: 120x60 child=30
+flex-column float width=auto height=auto tall min-height-large: 300x150 child=75
+flex-column float width=auto height=auto tall max-height: 60x30 child=15
+flex-column float width=auto height=auto tall min-width: 675x337.5 child=168.75
+flex-column float width=auto height=auto tall max-width: 40x20 child=10
+flex-column float width=auto height=auto tall min-width-max-height: 150x30 child=15
+flex-column float width=auto height=auto tall max-width-min-height: 40x60 child=30
+flex-column float width=auto height=auto tall border-box-min-height: 120x60 child=25
+flex-column float width=auto height=auto tall border-box-max-width: 40x20 child=5
+flex-column float width=auto height=100% empty min-height: 120x60 child=30
+flex-column float width=auto height=100% empty min-height-large: 300x150 child=75
flex-column float width=auto height=100% empty max-height: 0x0 child=0
-flex-column float width=auto height=100% empty min-width: 150x75 child=0
+flex-column float width=auto height=100% empty min-width: 150x75 child=37.5
flex-column float width=auto height=100% empty max-width: 0x0 child=0
-flex-column float width=auto height=100% empty min-width-max-height: 150x30 child=0
-flex-column float width=auto height=100% empty max-width-min-height: 40x60 child=0
-flex-column float width=auto height=100% empty border-box-min-height: 120x60 child=0
+flex-column float width=auto height=100% empty min-width-max-height: 150x30 child=15
+flex-column float width=auto height=100% empty max-width-min-height: 40x60 child=30
+flex-column float width=auto height=100% empty border-box-min-height: 120x60 child=25
flex-column float width=auto height=100% empty border-box-max-width: 20x10 child=0
-flex-column float width=auto height=100% tall min-height: 120x60 child=0
-flex-column float width=auto height=100% tall min-height-large: 300x150 child=0
-flex-column float width=auto height=100% tall max-height: 10x5 child=0
-flex-column float width=auto height=100% tall min-width: 150x75 child=0
-flex-column float width=auto height=100% tall max-width: 10x5 child=0
-flex-column float width=auto height=100% tall min-width-max-height: 150x30 child=0
-flex-column float width=auto height=100% tall max-width-min-height: 40x60 child=0
-flex-column float width=auto height=100% tall border-box-min-height: 120x60 child=0
+flex-column float width=auto height=100% tall min-height: 120x60 child=30
+flex-column float width=auto height=100% tall min-height-large: 300x150 child=75
+flex-column float width=auto height=100% tall max-height: 10x5 child=2.5
+flex-column float width=auto height=100% tall min-width: 150x75 child=37.5
+flex-column float width=auto height=100% tall max-width: 10x5 child=2.5
+flex-column float width=auto height=100% tall min-width-max-height: 150x30 child=15
+flex-column float width=auto height=100% tall max-width-min-height: 40x60 child=30
+flex-column float width=auto height=100% tall border-box-min-height: 120x60 child=25
flex-column float width=auto height=100% tall border-box-max-width: 20x10 child=0
flex-column float width=auto height=40px empty min-height: 120x60 child=30
flex-column float width=auto height=40px empty min-height-large: 300x150 child=75
@@ -5182,42 +5182,42 @@ flex-column float width=50% height=40px tall min-width-max-height: 150x30 child=
flex-column float width=50% height=40px tall max-width-min-height: 40x60 child=30
flex-column float width=50% height=40px tall border-box-min-height: 100x60 child=25
flex-column float width=50% height=40px tall border-box-max-width: 40x40 child=15
-flex-column flex width=auto height=auto empty min-height: 120x60 child=0
-flex-column flex width=auto height=auto empty min-height-large: 300x150 child=0
+flex-column flex width=auto height=auto empty min-height: 120x60 child=30
+flex-column flex width=auto height=auto empty min-height-large: 300x150 child=75
flex-column flex width=auto height=auto empty max-height: 0x0 child=0
-flex-column flex width=auto height=auto empty min-width: 150x75 child=0
+flex-column flex width=auto height=auto empty min-width: 150x75 child=37.5
flex-column flex width=auto height=auto empty max-width: 0x0 child=0
-flex-column flex width=auto height=auto empty min-width-max-height: 150x30 child=0
-flex-column flex width=auto height=auto empty max-width-min-height: 40x60 child=0
-flex-column flex width=auto height=auto empty border-box-min-height: 120x60 child=0
+flex-column flex width=auto height=auto empty min-width-max-height: 150x30 child=15
+flex-column flex width=auto height=auto empty max-width-min-height: 40x60 child=30
+flex-column flex width=auto height=auto empty border-box-min-height: 120x60 child=25
flex-column flex width=auto height=auto empty border-box-max-width: 20x10 child=0
-flex-column flex width=auto height=auto tall min-height: 120x60 child=0
-flex-column flex width=auto height=auto tall min-height-large: 300x150 child=0
-flex-column flex width=auto height=auto tall max-height: 60x30 child=0
-flex-column flex width=auto height=auto tall min-width: 600x300 child=0
-flex-column flex width=auto height=auto tall max-width: 40x20 child=0
-flex-column flex width=auto height=auto tall min-width-max-height: 150x30 child=0
-flex-column flex width=auto height=auto tall max-width-min-height: 40x60 child=0
-flex-column flex width=auto height=auto tall border-box-min-height: 120x60 child=0
-flex-column flex width=auto height=auto tall border-box-max-width: 40x20 child=0
-flex-column flex width=auto height=100% empty min-height: 120x60 child=0
-flex-column flex width=auto height=100% empty min-height-large: 300x150 child=0
+flex-column flex width=auto height=auto tall min-height: 120x60 child=30
+flex-column flex width=auto height=auto tall min-height-large: 300x150 child=75
+flex-column flex width=auto height=auto tall max-height: 60x30 child=15
+flex-column flex width=auto height=auto tall min-width: 600x300 child=150
+flex-column flex width=auto height=auto tall max-width: 40x20 child=10
+flex-column flex width=auto height=auto tall min-width-max-height: 150x30 child=15
+flex-column flex width=auto height=auto tall max-width-min-height: 40x60 child=30
+flex-column flex width=auto height=auto tall border-box-min-height: 120x60 child=25
+flex-column flex width=auto height=auto tall border-box-max-width: 40x20 child=5
+flex-column flex width=auto height=100% empty min-height: 120x60 child=30
+flex-column flex width=auto height=100% empty min-height-large: 300x150 child=75
flex-column flex width=auto height=100% empty max-height: 0x0 child=0
-flex-column flex width=auto height=100% empty min-width: 150x75 child=0
+flex-column flex width=auto height=100% empty min-width: 150x75 child=37.5
flex-column flex width=auto height=100% empty max-width: 0x0 child=0
-flex-column flex width=auto height=100% empty min-width-max-height: 150x30 child=0
-flex-column flex width=auto height=100% empty max-width-min-height: 40x60 child=0
-flex-column flex width=auto height=100% empty border-box-min-height: 120x60 child=0
+flex-column flex width=auto height=100% empty min-width-max-height: 150x30 child=15
+flex-column flex width=auto height=100% empty max-width-min-height: 40x60 child=30
+flex-column flex width=auto height=100% empty border-box-min-height: 120x60 child=25
flex-column flex width=auto height=100% empty border-box-max-width: 20x10 child=0
-flex-column flex width=auto height=100% tall min-height: 120x60 child=0
-flex-column flex width=auto height=100% tall min-height-large: 300x150 child=0
-flex-column flex width=auto height=100% tall max-height: 60x30 child=0
-flex-column flex width=auto height=100% tall min-width: 600x300 child=0
-flex-column flex width=auto height=100% tall max-width: 40x20 child=0
-flex-column flex width=auto height=100% tall min-width-max-height: 150x30 child=0
-flex-column flex width=auto height=100% tall max-width-min-height: 40x60 child=0
-flex-column flex width=auto height=100% tall border-box-min-height: 120x60 child=0
-flex-column flex width=auto height=100% tall border-box-max-width: 40x20 child=0
+flex-column flex width=auto height=100% tall min-height: 120x60 child=30
+flex-column flex width=auto height=100% tall min-height-large: 300x150 child=75
+flex-column flex width=auto height=100% tall max-height: 60x30 child=15
+flex-column flex width=auto height=100% tall min-width: 600x300 child=150
+flex-column flex width=auto height=100% tall max-width: 40x20 child=10
+flex-column flex width=auto height=100% tall min-width-max-height: 150x30 child=15
+flex-column flex width=auto height=100% tall max-width-min-height: 40x60 child=30
+flex-column flex width=auto height=100% tall border-box-min-height: 120x60 child=25
+flex-column flex width=auto height=100% tall border-box-max-width: 40x20 child=5
flex-column flex width=auto height=40px empty min-height: 120x60 child=30
flex-column flex width=auto height=40px empty min-height-large: 300x150 child=75
flex-column flex width=auto height=40px empty max-height: 60x30 child=15
@@ -5347,9 +5347,9 @@ flex-column flex width=50% height=40px tall border-box-max-width: 40x40 child=15
flex-column grid width=auto height=auto empty min-height: 120x60 child=30
flex-column grid width=auto height=auto empty min-height-large: 300x150 child=75
flex-column grid width=auto height=auto empty max-height: 0x0 child=0
-flex-column grid width=auto height=auto empty min-width: 150x75 child=0
+flex-column grid width=auto height=auto empty min-width: 150x75 child=37.5
flex-column grid width=auto height=auto empty max-width: 0x0 child=0
-flex-column grid width=auto height=auto empty min-width-max-height: 150x30 child=0
+flex-column grid width=auto height=auto empty min-width-max-height: 150x30 child=15
flex-column grid width=auto height=auto empty max-width-min-height: 40x60 child=30
flex-column grid width=auto height=auto empty border-box-min-height: 120x60 child=25
flex-column grid width=auto height=auto empty border-box-max-width: 20x10 child=0
@@ -5365,9 +5365,9 @@ flex-column grid width=auto height=auto tall border-box-max-width: 40x20 child=0
flex-column grid width=auto height=100% empty min-height: 120x60 child=30
flex-column grid width=auto height=100% empty min-height-large: 300x150 child=75
flex-column grid width=auto height=100% empty max-height: 0x0 child=0
-flex-column grid width=auto height=100% empty min-width: 150x75 child=0
+flex-column grid width=auto height=100% empty min-width: 150x75 child=37.5
flex-column grid width=auto height=100% empty max-width: 0x0 child=0
-flex-column grid width=auto height=100% empty min-width-max-height: 150x30 child=0
+flex-column grid width=auto height=100% empty min-width-max-height: 150x30 child=15
flex-column grid width=auto height=100% empty max-width-min-height: 40x60 child=30
flex-column grid width=auto height=100% empty border-box-min-height: 120x60 child=25
flex-column grid width=auto height=100% empty border-box-max-width: 20x10 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 e2156c65e30..3c1e2d3570f 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
@@ -2016,28 +2016,28 @@ flex-row-stretch abspos width=50% height=auto tall min-height: 100x60 child=30
flex-row-stretch abspos width=50% height=auto tall padding: 100x330 child=20
flex-column block width=auto height=100% empty none: 0x0 child=0
flex-column block width=auto height=100% empty max-height: 0x0 child=0
-flex-column block width=auto height=100% empty min-height: 120x60 child=0
+flex-column block width=auto height=100% empty min-height: 120x60 child=30
flex-column block width=auto height=100% empty padding: 20x10 child=0
-flex-column block width=auto height=100% tall none: 10x5 child=0
-flex-column block width=auto height=100% tall max-height: 10x5 child=0
-flex-column block width=auto height=100% tall min-height: 120x60 child=0
+flex-column block width=auto height=100% tall none: 10x5 child=2.5
+flex-column block width=auto height=100% tall max-height: 10x5 child=2.5
+flex-column block width=auto height=100% tall min-height: 120x60 child=30
flex-column block width=auto height=100% tall padding: 20x10 child=0
flex-column block width=auto height=calc empty none: 0x0 child=0
flex-column block width=auto height=calc empty max-height: 0x0 child=0
-flex-column block width=auto height=calc empty min-height: 120x60 child=0
+flex-column block width=auto height=calc empty min-height: 120x60 child=30
flex-column block width=auto height=calc empty padding: 20x10 child=0
-flex-column block width=auto height=calc tall none: 10x5 child=0
-flex-column block width=auto height=calc tall max-height: 10x5 child=0
-flex-column block width=auto height=calc tall min-height: 120x60 child=0
+flex-column block width=auto height=calc tall none: 10x5 child=2.5
+flex-column block width=auto height=calc tall max-height: 10x5 child=2.5
+flex-column block width=auto height=calc tall min-height: 120x60 child=30
flex-column block width=auto height=calc tall padding: 20x10 child=0
flex-column block width=auto height=auto empty none: 0x0 child=0
flex-column block width=auto height=auto empty max-height: 0x0 child=0
-flex-column block width=auto height=auto empty min-height: 120x60 child=0
+flex-column block width=auto height=auto empty min-height: 120x60 child=30
flex-column block width=auto height=auto empty padding: 20x10 child=0
-flex-column block width=auto height=auto tall none: 605x302.5 child=0
-flex-column block width=auto height=auto tall max-height: 60x30 child=0
-flex-column block width=auto height=auto tall min-height: 120x60 child=0
-flex-column block width=auto height=auto tall padding: 620x310 child=0
+flex-column block width=auto height=auto tall none: 605x302.5 child=151.25
+flex-column block width=auto height=auto tall max-height: 60x30 child=15
+flex-column block width=auto height=auto tall min-height: 120x60 child=30
+flex-column block width=auto height=auto tall padding: 620x310 child=150
flex-column block width=80px height=100% empty none: 80x40 child=20
flex-column block width=80px height=100% empty max-height: 80x30 child=15
flex-column block width=80px height=100% empty min-height: 80x60 child=30
@@ -2088,28 +2088,28 @@ flex-column block width=50% height=auto tall min-height: 100x60 child=30
flex-column block width=50% height=auto tall padding: 100x330 child=160
flex-column flow-root width=auto height=100% empty none: 0x0 child=0
flex-column flow-root width=auto height=100% empty max-height: 0x0 child=0
-flex-column flow-root width=auto height=100% empty min-height: 120x60 child=0
+flex-column flow-root width=auto height=100% empty min-height: 120x60 child=30
flex-column flow-root width=auto height=100% empty padding: 20x10 child=0
-flex-column flow-root width=auto height=100% tall none: 10x5 child=0
-flex-column flow-root width=auto height=100% tall max-height: 10x5 child=0
-flex-column flow-root width=auto height=100% tall min-height: 120x60 child=0
+flex-column flow-root width=auto height=100% tall none: 10x5 child=2.5
+flex-column flow-root width=auto height=100% tall max-height: 10x5 child=2.5
+flex-column flow-root width=auto height=100% tall min-height: 120x60 child=30
flex-column flow-root width=auto height=100% tall padding: 20x10 child=0
flex-column flow-root width=auto height=calc empty none: 0x0 child=0
flex-column flow-root width=auto height=calc empty max-height: 0x0 child=0
-flex-column flow-root width=auto height=calc empty min-height: 120x60 child=0
+flex-column flow-root width=auto height=calc empty min-height: 120x60 child=30
flex-column flow-root width=auto height=calc empty padding: 20x10 child=0
-flex-column flow-root width=auto height=calc tall none: 10x5 child=0
-flex-column flow-root width=auto height=calc tall max-height: 10x5 child=0
-flex-column flow-root width=auto height=calc tall min-height: 120x60 child=0
+flex-column flow-root width=auto height=calc tall none: 10x5 child=2.5
+flex-column flow-root width=auto height=calc tall max-height: 10x5 child=2.5
+flex-column flow-root width=auto height=calc tall min-height: 120x60 child=30
flex-column flow-root width=auto height=calc tall padding: 20x10 child=0
flex-column flow-root width=auto height=auto empty none: 0x0 child=0
flex-column flow-root width=auto height=auto empty max-height: 0x0 child=0
-flex-column flow-root width=auto height=auto empty min-height: 120x60 child=0
+flex-column flow-root width=auto height=auto empty min-height: 120x60 child=30
flex-column flow-root width=auto height=auto empty padding: 20x10 child=0
-flex-column flow-root width=auto height=auto tall none: 605x302.5 child=0
-flex-column flow-root width=auto height=auto tall max-height: 60x30 child=0
-flex-column flow-root width=auto height=auto tall min-height: 120x60 child=0
-flex-column flow-root width=auto height=auto tall padding: 620x310 child=0
+flex-column flow-root width=auto height=auto tall none: 605x302.5 child=151.25
+flex-column flow-root width=auto height=auto tall max-height: 60x30 child=15
+flex-column flow-root width=auto height=auto tall min-height: 120x60 child=30
+flex-column flow-root width=auto height=auto tall padding: 620x310 child=150
flex-column flow-root width=80px height=100% empty none: 80x40 child=20
flex-column flow-root width=80px height=100% empty max-height: 80x30 child=15
flex-column flow-root width=80px height=100% empty min-height: 80x60 child=30
@@ -2160,28 +2160,28 @@ flex-column flow-root width=50% height=auto tall min-height: 100x60 child=30
flex-column flow-root width=50% height=auto tall padding: 100x330 child=160
flex-column inline-block width=auto height=100% empty none: 0x0 child=0
flex-column inline-block width=auto height=100% empty max-height: 0x0 child=0
-flex-column inline-block width=auto height=100% empty min-height: 120x60 child=0
+flex-column inline-block width=auto height=100% empty min-height: 120x60 child=30
flex-column inline-block width=auto height=100% empty padding: 20x10 child=0
-flex-column inline-block width=auto height=100% tall none: 10x5 child=0
-flex-column inline-block width=auto height=100% tall max-height: 10x5 child=0
-flex-column inline-block width=auto height=100% tall min-height: 120x60 child=0
+flex-column inline-block width=auto height=100% tall none: 10x5 child=2.5
+flex-column inline-block width=auto height=100% tall max-height: 10x5 child=2.5
+flex-column inline-block width=auto height=100% tall min-height: 120x60 child=30
flex-column inline-block width=auto height=100% tall padding: 20x10 child=0
flex-column inline-block width=auto height=calc empty none: 0x0 child=0
flex-column inline-block width=auto height=calc empty max-height: 0x0 child=0
-flex-column inline-block width=auto height=calc empty min-height: 120x60 child=0
+flex-column inline-block width=auto height=calc empty min-height: 120x60 child=30
flex-column inline-block width=auto height=calc empty padding: 20x10 child=0
-flex-column inline-block width=auto height=calc tall none: 10x5 child=0
-flex-column inline-block width=auto height=calc tall max-height: 10x5 child=0
-flex-column inline-block width=auto height=calc tall min-height: 120x60 child=0
+flex-column inline-block width=auto height=calc tall none: 10x5 child=2.5
+flex-column inline-block width=auto height=calc tall max-height: 10x5 child=2.5
+flex-column inline-block width=auto height=calc tall min-height: 120x60 child=30
flex-column inline-block width=auto height=calc tall padding: 20x10 child=0
flex-column inline-block width=auto height=auto empty none: 0x0 child=0
flex-column inline-block width=auto height=auto empty max-height: 0x0 child=0
-flex-column inline-block width=auto height=auto empty min-height: 120x60 child=0
+flex-column inline-block width=auto height=auto empty min-height: 120x60 child=30
flex-column inline-block width=auto height=auto empty padding: 20x10 child=0
-flex-column inline-block width=auto height=auto tall none: 605x302.5 child=0
-flex-column inline-block width=auto height=auto tall max-height: 60x30 child=0
-flex-column inline-block width=auto height=auto tall min-height: 120x60 child=0
-flex-column inline-block width=auto height=auto tall padding: 620x310 child=0
+flex-column inline-block width=auto height=auto tall none: 605x302.5 child=151.25
+flex-column inline-block width=auto height=auto tall max-height: 60x30 child=15
+flex-column inline-block width=auto height=auto tall min-height: 120x60 child=30
+flex-column inline-block width=auto height=auto tall padding: 620x310 child=150
flex-column inline-block width=80px height=100% empty none: 80x40 child=20
flex-column inline-block width=80px height=100% empty max-height: 80x30 child=15
flex-column inline-block width=80px height=100% empty min-height: 80x60 child=30
@@ -2232,28 +2232,28 @@ flex-column inline-block width=50% height=auto tall min-height: 100x60 child=30
flex-column inline-block width=50% height=auto tall padding: 100x330 child=160
flex-column float width=auto height=100% empty none: 0x0 child=0
flex-column float width=auto height=100% empty max-height: 0x0 child=0
-flex-column float width=auto height=100% empty min-height: 120x60 child=0
+flex-column float width=auto height=100% empty min-height: 120x60 child=30
flex-column float width=auto height=100% empty padding: 20x10 child=0
-flex-column float width=auto height=100% tall none: 10x5 child=0
-flex-column float width=auto height=100% tall max-height: 10x5 child=0
-flex-column float width=auto height=100% tall min-height: 120x60 child=0
+flex-column float width=auto height=100% tall none: 10x5 child=2.5
+flex-column float width=auto height=100% tall max-height: 10x5 child=2.5
+flex-column float width=auto height=100% tall min-height: 120x60 child=30
flex-column float width=auto height=100% tall padding: 20x10 child=0
flex-column float width=auto height=calc empty none: 0x0 child=0
flex-column float width=auto height=calc empty max-height: 0x0 child=0
-flex-column float width=auto height=calc empty min-height: 120x60 child=0
+flex-column float width=auto height=calc empty min-height: 120x60 child=30
flex-column float width=auto height=calc empty padding: 20x10 child=0
-flex-column float width=auto height=calc tall none: 10x5 child=0
-flex-column float width=auto height=calc tall max-height: 10x5 child=0
-flex-column float width=auto height=calc tall min-height: 120x60 child=0
+flex-column float width=auto height=calc tall none: 10x5 child=2.5
+flex-column float width=auto height=calc tall max-height: 10x5 child=2.5
+flex-column float width=auto height=calc tall min-height: 120x60 child=30
flex-column float width=auto height=calc tall padding: 20x10 child=0
flex-column float width=auto height=auto empty none: 0x0 child=0
flex-column float width=auto height=auto empty max-height: 0x0 child=0
-flex-column float width=auto height=auto empty min-height: 120x60 child=0
+flex-column float width=auto height=auto empty min-height: 120x60 child=30
flex-column float width=auto height=auto empty padding: 20x10 child=0
-flex-column float width=auto height=auto tall none: 605x302.5 child=0
-flex-column float width=auto height=auto tall max-height: 60x30 child=0
-flex-column float width=auto height=auto tall min-height: 120x60 child=0
-flex-column float width=auto height=auto tall padding: 620x310 child=0
+flex-column float width=auto height=auto tall none: 605x302.5 child=151.25
+flex-column float width=auto height=auto tall max-height: 60x30 child=15
+flex-column float width=auto height=auto tall min-height: 120x60 child=30
+flex-column float width=auto height=auto tall padding: 620x310 child=150
flex-column float width=80px height=100% empty none: 80x40 child=20
flex-column float width=80px height=100% empty max-height: 80x30 child=15
flex-column float width=80px height=100% empty min-height: 80x60 child=30
@@ -2304,28 +2304,28 @@ flex-column float width=50% height=auto tall min-height: 100x60 child=30
flex-column float width=50% height=auto tall padding: 100x330 child=160
flex-column flex width=auto height=100% empty none: 0x0 child=0
flex-column flex width=auto height=100% empty max-height: 0x0 child=0
-flex-column flex width=auto height=100% empty min-height: 120x60 child=0
+flex-column flex width=auto height=100% empty min-height: 120x60 child=30
flex-column flex width=auto height=100% empty padding: 20x10 child=0
-flex-column flex width=auto height=100% tall none: 600x300 child=0
-flex-column flex width=auto height=100% tall max-height: 60x30 child=0
-flex-column flex width=auto height=100% tall min-height: 120x60 child=0
-flex-column flex width=auto height=100% tall padding: 620x310 child=0
+flex-column flex width=auto height=100% tall none: 600x300 child=150
+flex-column flex width=auto height=100% tall max-height: 60x30 child=15
+flex-column flex width=auto height=100% tall min-height: 120x60 child=30
+flex-column flex width=auto height=100% tall padding: 620x310 child=150
flex-column flex width=auto height=calc empty none: 0x0 child=0
flex-column flex width=auto height=calc empty max-height: 0x0 child=0
-flex-column flex width=auto height=calc empty min-height: 120x60 child=0
+flex-column flex width=auto height=calc empty min-height: 120x60 child=30
flex-column flex width=auto height=calc empty padding: 20x10 child=0
-flex-column flex width=auto height=calc tall none: 600x300 child=0
-flex-column flex width=auto height=calc tall max-height: 60x30 child=0
-flex-column flex width=auto height=calc tall min-height: 120x60 child=0
-flex-column flex width=auto height=calc tall padding: 620x310 child=0
+flex-column flex width=auto height=calc tall none: 600x300 child=150
+flex-column flex width=auto height=calc tall max-height: 60x30 child=15
+flex-column flex width=auto height=calc tall min-height: 120x60 child=30
+flex-column flex width=auto height=calc tall padding: 620x310 child=150
flex-column flex width=auto height=auto empty none: 0x0 child=0
flex-column flex width=auto height=auto empty max-height: 0x0 child=0
-flex-column flex width=auto height=auto empty min-height: 120x60 child=0
+flex-column flex width=auto height=auto empty min-height: 120x60 child=30
flex-column flex width=auto height=auto empty padding: 20x10 child=0
-flex-column flex width=auto height=auto tall none: 600x300 child=0
-flex-column flex width=auto height=auto tall max-height: 60x30 child=0
-flex-column flex width=auto height=auto tall min-height: 120x60 child=0
-flex-column flex width=auto height=auto tall padding: 620x310 child=0
+flex-column flex width=auto height=auto tall none: 600x300 child=150
+flex-column flex width=auto height=auto tall max-height: 60x30 child=15
+flex-column flex width=auto height=auto tall min-height: 120x60 child=30
+flex-column flex width=auto height=auto tall padding: 620x310 child=150
flex-column flex width=80px height=100% empty none: 80x40 child=20
flex-column flex width=80px height=100% empty max-height: 80x30 child=15
flex-column flex width=80px height=100% empty min-height: 80x60 child=30