DescriptionDon't add to siblingRules for features left of ::slotted.
Like for ::content distributed elements in shadow dom v0, slotted
elements do not share style if they are assigned/distributed to
different slots. Hence, we don't need to add rules to siblingRules when
the combinators or simple selectors are left of the ::slotted pseudo.
We need to add "::slotted(:nth-child(odd)" to siblingRules, but not
".a + ::slotted(.b)" nor ":nth-of-type(3)::slotted(*)".
Similarly, nothing left of :host or :host-context will ever match, so
we can treat those the same way. Selectors like "div + :host" or
":only-child:host-context(.a)" will never match. There is nothing in
the CSS Scoping spec which says they're invalid, hence they're not
dropped.
There was a bug in https://codereview.chromium.org/1683923003/ which
made us detect adjacent combinators before we had noticed the ::content
following it. The detection of sibling dependent pseudo classes like
:emtpy, :nth-child, etc and adjacent combinators have therefore been
split in this CL so that we handle the simple selectors in a compound
before we handle the combinator. Corresponding unit tests have been
added.
R=kochi@chromium.org,hayato@chromium.org
Committed: https://crrev.com/593fca77e1a391c59c4cf14a5ecf54c35e2cef65
Cr-Commit-Position: refs/heads/master@{#375531}
Patch Set 1 #
Messages
Total messages: 11 (4 generated)
|