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 <obrufau@igalia.com>
This commit is contained in:
Oriol Brufau 2024-08-27 15:43:50 +02:00 committed by GitHub
parent 2537234090
commit dbd0a79b3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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),
}
}