Commit c48e53c0 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Chromium LUCI CQ

Skip root/body propagation after recalc early

If the style recalc root is neither the root element, nor body, we can
skip propagation from root/body. Skipping that early is more important
when you have many containers for container queries which means
RecalcStyle will be called multiple times during layout.

TEST=external/wpt/css/css-writing-modes/

Bug: 1146097
Change-Id: I12514f54cec3400f028eb7efbb5ec34ce241d672
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2574280Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834206}
parent 37d1ee03
...@@ -2003,7 +2003,8 @@ void StyleEngine::RecalcStyle(StyleRecalcChange change) { ...@@ -2003,7 +2003,8 @@ void StyleEngine::RecalcStyle(StyleRecalcChange change) {
ancestor->ClearChildNeedsStyleRecalc(); ancestor->ClearChildNeedsStyleRecalc();
} }
style_recalc_root_.Clear(); style_recalc_root_.Clear();
PropagateWritingModeAndDirectionToHTMLRoot(); if (!parent || IsA<HTMLBodyElement>(*root_element))
PropagateWritingModeAndDirectionToHTMLRoot();
} }
void StyleEngine::ClearEnsuredDescendantStyles(Element& root) { void StyleEngine::ClearEnsuredDescendantStyles(Element& root) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment