diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index 1813e58daad..8331f54ea09 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -134,20 +134,27 @@ impl BlockContainer { ), } } - + pub(super) fn inline_content_sizes( &self, layout_context: &LayoutContext, writing_mode: WritingMode, ) -> ContentSizes { match &self { - Self::BlockLevelBoxes(boxes) => boxes + Self::BlockLevelBoxes(boxes) if layout_context.use_rayon => boxes .par_iter() .map(|box_| { box_.borrow_mut() .inline_content_sizes(layout_context, writing_mode) }) .reduce(ContentSizes::zero, ContentSizes::max), + Self::BlockLevelBoxes(boxes) => boxes + .iter() + .map(|box_| { + box_.borrow_mut() + .inline_content_sizes(layout_context, writing_mode) + }) + .reduce(ContentSizes::max).unwrap_or_else(ContentSizes::zero), Self::InlineFormattingContext(context) => { context.inline_content_sizes(layout_context, writing_mode) },