Allow style recalc roots in shadow trees.
When we mark the light tree ancestors child-dirty for style, we could not set a node inside a shadow scope as a style recalc root because slotted nodes could require traversal via the host light tree parent. With FlatTreeStyleRecalc enabled, we can now allow that. This affected performance for the perf_test below because the elements needing recalc where light-tree children of a shadow host high up the light-tree which were slotted deep into the chain of shadow hosts with slots. With the recalc root in the document scope, that made us traverse deep in the flat tree to reach the dirty nodes, while the light-tree traversal would skip the shadow trees and recalc the styles for the dirty nodes as part of the light tree children of the outer shadow host. It's not certain this makes all the perf regression recover, but local testing shows that it definitely improves. TEST=perf_tests/shadow_dom/v1-mutate-shallow-tree-then-re-layout.html Bug: 1023215 Change-Id: Id7143bf0e8fd7c298d6b683be8ead0fd23941f4b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1912711Reviewed-by:Mason Freed <masonfreed@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#714981}
Showing
Please register or sign in to comment