diff --git a/components/layout/flow/mod.rs b/components/layout/flow/mod.rs index 21ae2d97085..85fdf96939e 100644 --- a/components/layout/flow/mod.rs +++ b/components/layout/flow/mod.rs @@ -1391,14 +1391,16 @@ impl IndependentFormattingContext { ) }; - let lazy_block_size = LazySize::new( - &content_box_sizes.block, - Direction::Block, - Size::FitContent, - Au::zero, - available_block_size, - is_table, - ); + let get_lazy_block_size = || { + LazySize::new( + &content_box_sizes.block, + Direction::Block, + Size::FitContent, + Au::zero, + available_block_size, + is_table, + ) + }; // The final inline size can depend on the available space, which depends on where // we are placing the box, since floats reduce the available space. @@ -1414,6 +1416,7 @@ impl IndependentFormattingContext { // compute it with an available inline space of zero. Then, after layout we can // compute the block size, and finally place among floats. let inline_size = inline_size_with_no_available_space; + let lazy_block_size = get_lazy_block_size(); layout = self.layout( layout_context, positioning_context, @@ -1479,6 +1482,7 @@ impl IndependentFormattingContext { // Later we'll check to see if the resulting block size is compatible with the // placement. let positioning_context_length = positioning_context.len(); + let lazy_block_size = get_lazy_block_size(); layout = self.layout( layout_context, positioning_context, diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index 90357bd200f..b871bef05e3 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -59963,6 +59963,19 @@ {} ] ], + "floats-bfc-003.html": [ + "a40c6ae6c0e9edb2c696fc324abfa0c9eca35a91", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "floats-clear-multicol-000.html": [ "3598a2f7aba955b5ba3e6ee1739bfd468d2b28ea", [ diff --git a/tests/wpt/tests/css/CSS2/floats-clear/floats-bfc-003.html b/tests/wpt/tests/css/CSS2/floats-clear/floats-bfc-003.html new file mode 100644 index 00000000000..a40c6ae6c0e --- /dev/null +++ b/tests/wpt/tests/css/CSS2/floats-clear/floats-bfc-003.html @@ -0,0 +1,26 @@ + +CSS Test: Floats with overflow:hidden next to them + + + + + + +

Test passes if there is a filled green square and no red.

+
+
+
+
+
+
+
+
+
+