Don't schedule sibling invalidation sets with too low combinator count
Reported by
r...@opera.com,
Jun 30 2016
|
||
Issue descriptionWhen scheduling sibling invalidation sets for insertion/removal of nodes, we schedule sibling invalidation sets N preceding siblings without checking if the invalidation set's max adjacent count is checked. If the max count is lower than the distance from the scheduling element to the mutation position, we may skip scheduling the set.
,
Jul 1 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6fd5c3b21a538a976c97c92a97645aafec77c572 commit 6fd5c3b21a538a976c97c92a97645aafec77c572 Author: rune <rune@opera.com> Date: Fri Jul 01 21:06:44 2016 Skip scheduling sibling invalidation based on direct adjacent count. When scheduling sibling invalidation sets for sibling insertion/removal we schedule sets for N preceding siblings where N is the maximum number of consecutive direct adjacent combinators, or infinite for indirect adjacent combinators. However, the further left of the mutation we schedule, the more direct adjacent combinators are required to affect siblings following the mutation. The maximum adjacent number is stored for every sibling invalidation set, which means we can drop scheduling the set if that count is too low. Example: Selectors: .a + div + div + span {} .b + span {} .c + span {} Siblings: div.x div.a div.b div.c div#remove span When removing #remove we start scheduling sibling invalidations for div.c which needs at least one adjacent combinator to reach the span or any subsequent elements. div.b needs at least two, and so on. For the case above, we schedule the set for .c, but not for .b since the max adjacent combinator count for .b is 1 and it needs to be at least 2. .a needs to have at least 3, which is the case, so we schedule the set for .a. We never consider the div.x element because the max adjacent combinator count for the document is 3. R=esprehn@chromium.org BUG= 624782 Review-Url: https://codereview.chromium.org/2116503002 Cr-Commit-Position: refs/heads/master@{#403530} [add] https://crrev.com/6fd5c3b21a538a976c97c92a97645aafec77c572/third_party/WebKit/LayoutTests/fast/css/invalidation/sibling-mutation-min-direct.html [modify] https://crrev.com/6fd5c3b21a538a976c97c92a97645aafec77c572/third_party/WebKit/Source/core/css/RuleFeature.cpp [modify] https://crrev.com/6fd5c3b21a538a976c97c92a97645aafec77c572/third_party/WebKit/Source/core/css/RuleFeature.h [modify] https://crrev.com/6fd5c3b21a538a976c97c92a97645aafec77c572/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp [modify] https://crrev.com/6fd5c3b21a538a976c97c92a97645aafec77c572/third_party/WebKit/Source/core/dom/StyleEngine.cpp [modify] https://crrev.com/6fd5c3b21a538a976c97c92a97645aafec77c572/third_party/WebKit/Source/core/dom/StyleEngine.h
,
Jul 1 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by r...@opera.com
, Jun 30 2016