DescriptionFixed ::slotted performance in pure v1 shadow documents.
Instead of traversing all m_treeBoundaryCrossingScopes matching rules
from other scopes, just walk the assignedSlot() chain for resolvers.
This makes rule matching a lot cheaper since quite a lot of components
have tree boundary crossing rules in practice (polymer apps using v0
typically have hundreds of such scopes).
The assumption here is that the assignedSlot chain most of the time
will be quite short and/or cheap to walk.
Introducing a flag set in StyleEngine if there ever exists a v0 shadow
tree to fall back to traversing m_treeBoundaryCrossingScopes when
necessary.
For the slotted.html demo in crbug.com/599833, the full recalc with
~4000 elements goes from ~800ms to ~40ms with this change when each
shadow tree has a ::slotted rule. No substantial regression for the
case without ::slotted rules.
Added a test for /deep/ being used a descendant combinator in a
document without shadow trees, as I feared I might have broken that and
I couldn't find any existing tests for it.
For later, we may choose to never collect m_treeBoundaryCrossingScopes
for pure v1 documents, but that means we would have to recreate that
collection once we add a v0 shadow to the document.
R=kochi@chromium.org,hayato@chromium.org,dglazkov@chromium.org
BUG=599833
Committed: https://crrev.com/34d768eb8c2c2bdd8e9cd259a0661b31d5f4c303
Cr-Commit-Position: refs/heads/master@{#384867}
Patch Set 1 #Patch Set 2 : Missing Member<> in HeapVector template #
Total comments: 1
Messages
Total messages: 17 (8 generated)
|