Handle floats in BlockContainer::inline_content_sizes

Typically, block-level contents are stacked vertically, so this was just
taking the maximum size among all contents. However, floats can be
stacked horizontally, so we need to sum their sizes.
This commit is contained in:
Oriol Brufau 2023-06-14 23:26:34 +02:00
parent 47fb54fc54
commit 4ec6dd1783
4 changed files with 112 additions and 28 deletions

View file

@ -690,12 +690,7 @@ impl FloatBox {
.floats
.lower_ceiling(sequential_layout_state.current_block_position_including_margins());
let style = match self.contents {
IndependentFormattingContext::Replaced(ref replaced) => replaced.style.clone(),
IndependentFormattingContext::NonReplaced(ref non_replaced) => {
non_replaced.style.clone()
},
};
let style = self.contents.style().clone();
let float_context = &mut sequential_layout_state.floats;
let box_fragment = positioning_context.layout_maybe_position_relative_fragment(
layout_context,