diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs index c84e2a7eead..11b8f4a5ce5 100644 --- a/components/layout_2020/flow/inline.rs +++ b/components/layout_2020/flow/inline.rs @@ -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, diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index 9c5cae51877..8a0b1735006 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -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, } } }