From 5afe12ba2c3cbc2d7941d2dc62fba2cec1cebf2a Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 10 Oct 2016 17:16:02 -0700 Subject: [PATCH] layout: Don't use the existing block position as the float ceiling when placing block formatting contexts in the sequential fallback. The existing block position isn't yet computed at that time, so it contains junk data. It just so happened to work on first reflow because that value is usually set to zero, but it usually failed on subsequent reflows. Improves certain Wikipedia pages. Closes #13630 (though Google is still broken; it was a separate bug and will be split off into a separate issue). --- components/layout/block.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/layout/block.rs b/components/layout/block.rs index e28e85d139a..75dcc9afd72 100644 --- a/components/layout/block.rs +++ b/components/layout/block.rs @@ -1494,11 +1494,9 @@ impl BlockFlow { debug_assert!(!self.is_flex()); // Compute the available space for us, based on the actual floats. - let rect = self.base.floats.available_rect( - self.base.position.start.b, - self.fragment.border_box.size.block, - content_box.size.inline - ); + let rect = self.base.floats.available_rect(Au(0), + self.fragment.border_box.size.block, + content_box.size.inline); let available_inline_size = if let Some(rect) = rect { // Offset our position by whatever displacement is needed to not impact the floats. // Also, account for margins sliding behind floats.