layout: IFCs should not always be marked as containing floats (#31641)

Marking all IFCs as containing floats shouldn't change layout results,
but does prevent parallel layout in some cases. This change fixes an
issue where we were marking all IFCs as containing floats.

Fixes #31540.
This commit is contained in:
Martin Robinson 2024-03-14 10:55:01 +01:00 committed by GitHub
parent eaa800c8dd
commit 871a9bf677
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -971,7 +971,9 @@ impl<'a, 'b> InlineFormattingContextState<'a, 'b> {
match text_align {
TextAlign::Start => text_indent,
TextAlign::End => (available_space - line_length).max(text_indent),
TextAlign::Center => (available_space - line_length + text_indent) / 2.,
TextAlign::Center => {
((available_space - line_length + text_indent) / 2.).max(text_indent)
},
};
// Calculate the justification adjustment. This is simply the remaining space on the line,

View file

@ -64,7 +64,7 @@ impl BlockContainer {
BlockContainer::BlockLevelBoxes(boxes) => boxes
.iter()
.any(|block_level_box| block_level_box.borrow().contains_floats()),
BlockContainer::InlineFormattingContext { .. } => true,
BlockContainer::InlineFormattingContext(context) => context.contains_floats,
}
}
}