Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Issue 946993002: Avoid style invalidation for empty sets. (Closed)

Created:
5 years, 10 months ago by rune
Modified:
5 years, 10 months ago
Reviewers:
chrishtr, esprehn
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, dglazkov+blink, ed+blinkwatch_opera.com, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Avoid 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)
rune
5 years, 10 months ago (2015-02-23 13:33:00 UTC) #2
esprehn
lgtm, thanks for continuing to make the invalidator awesome.
5 years, 10 months ago (2015-02-23 16:46:32 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/946993002/40001
5 years, 10 months ago (2015-02-23 17:57:21 UTC) #5
commit-bot: I haz the power
5 years, 10 months ago (2015-02-23 19:36:42 UTC) #6
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=190680

Powered by Google App Engine
This is Rietveld 408576698