DescriptionAvoid style invalidation for empty sets.
Invalidation sets which are empty stems from selector features only found
in the rightmost compound selector, and can only cause invalidation of
elements for which they are scheduled. When adding these sets, just mark
the element with a LocalStyleChange and do not schedule a style
invalidation for them.
Similarly, mark with a SubtreeStyleChange and clear all scheduled
invalidation sets for an element which gets a wholeSubtreeInvalid set
scheduled.
This fixes two sub-optimal behaviors in the code.
1. We avoid running style invalidation, hence traversing the DOM tree an
extra time, if we only have local/subtree changes scheduled.
2. We avoid traversing subtrees checking against an empty invalidation set
that will never match.
Note that we will still have to run the style invalidation step to clear
style invalidation bits on elements if there were invalidation sets
scheduled prior to a SubtreeStyleChange that nuked the entry in the
m_pendingInvalidationMap.
Added missing check for m_customPseudoInvalid in isEmpty and resetting it
in setWholeSubtreeInvalid() was added.
Since rules of type ".x {}" will not lead to a style invalidation pass
anymore, ".x .dummy {}" type rules have been added to the inspector tests
when testing style invalidation tracking.
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=190680
Patch Set 1 #Patch Set 2 : Element can now get SubtreeStyleChange during class change schedule #Patch Set 3 : Added dummy selectors to tests to force descendant invalidation #Messages
Total messages: 6 (2 generated)
|