Use invalidation sets when selector contains adjacent combinators.

When we found a direct or indirect adjacent combinator, we fell back on
using a subtree recalc for all features in the selector in question. That
is not necessary as we can resume the process of adding separate features
to the invalidation sets once we encounter a non-adjacent combinator going
leftwards.

Example:

  .a .b + .c { }

We have an empty invalidation set for 'c', 'b' currently needs to do a sub-
tree recalc to recalculate the 'c' class element when 'b' is added or
removed. However, once we see the descendant combinator left of '.b' we can
get away with adding 'c' to the invalidation set for 'a' since 'c' will
have to be in 'a's sub-tree.

Eventually, I think we could merge collectFeaturesFromSelector with
updateInvalidationSet to get rid of a pass through the selector.

R=esprehn@chromium.org
BUG=351613,335247

Review URL: https://codereview.chromium.org/224593002

git-svn-id: svn://svn.chromium.org/blink/trunk@170881 bbb929c8-8fbe-4397-9dbb-9b2b20218538
8 files changed
tree: bdd735f4e9dd3662bd6219e9867af28636cfb70c
  1. third_party/