From dbd0a79b3e45b60a29d26c0af20297ab260f2a8b Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Tue, 27 Aug 2024 15:43:50 +0200 Subject: [PATCH] Allow caching `IndependentFormattingContext::inline_content_sizes()` (#33207) For non-replaced formatting contexts, this method redirected directly to `NonReplacedFormattingContextContents::inline_content_sizes()`, which has the actual logic for the computation. Thus it was bypassing the cache, which is handled in `NonReplacedFormattingContext::inline_content_sizes()`. Therefore, this patch redirects to the latter. Signed-off-by: Oriol Brufau --- components/layout_2020/formatting_contexts.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/layout_2020/formatting_contexts.rs b/components/layout_2020/formatting_contexts.rs index 1330bf18c0c..9381f2b50ef 100644 --- a/components/layout_2020/formatting_contexts.rs +++ b/components/layout_2020/formatting_contexts.rs @@ -178,9 +178,7 @@ impl IndependentFormattingContext { pub fn inline_content_sizes(&mut self, layout_context: &LayoutContext) -> ContentSizes { match self { - Self::NonReplaced(inner) => inner - .contents - .inline_content_sizes(layout_context, inner.style.effective_writing_mode()), + Self::NonReplaced(inner) => inner.inline_content_sizes(layout_context), Self::Replaced(inner) => inner.contents.inline_content_sizes(&inner.style), } }