DescriptionSkip 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
Committed: https://crrev.com/6fd5c3b21a538a976c97c92a97645aafec77c572
Cr-Commit-Position: refs/heads/master@{#403530}
Patch Set 1 #
Messages
Total messages: 17 (7 generated)
|