Only match style from element's TreeScope for normal rules.

We collected all scoped resolvers up to the document resolver while
collecting normal style rules. That was necessary for <style scoped>, but
now that all scoping is done through shadow roots, only boundary crossing
rules can match from other author style scopes. Those rules are handled
through the global TreeBoundaryCrossingRules.

Instead, collect using the ScopedStyleResolver for the element's tree
scope if present. The need for CascadeScope disappears, so it's been
removed.

There is an exception for custom pseudo elements and VTT elements (styled
through ::cue) since those rules are crossing a shadow boundary, yet not
handled as part of boundary crossing rules. I chose to do the special
handling instead of start adding them to the boundary crossing rules
since the boundary crossing rule handling is about to change as part of
401359 anyway, and the special handling is safer since it's closer to the
previous behavior.

R=hayato@chromium.org
BUG=401359

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

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