[Bug 22980] [Shadow]: shadowRoot styles should not match the host element

https://www.w3.org/Bugs/Public/show_bug.cgi?id=22980

--- Comment #2 from Steve Orvell <sorvell@chromium.org> ---
Yeah, we did agree that this should match (big sigh). I think that was a
mistake and we now have a wart on an otherwise pretty face. I'd be happy to be
convinced otherwise.

My main concern is that ShadowDOM authors will have to defend against
accidentally having styles match host by not writing simple selectors. Imagine
rules like this inside a shadowRoot style element. The author intends to match
elements inside the shadowRoot:

  #container {
    border: 1px solid black;
  }

  .rounded {
    border-radius: 10px;
  }

If the host incidentally matches one of those selectors, things will blow up.
To avoid this the ShadowDOM author is forced to always write:

:host #container {...}
:host .rounded {...}

That seems pretty unfortunate doesn't it? Am I missing a virtue of having these
styles match the host element? It seems like we have the host element well
covered via :host.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 16 August 2013 16:06:41 UTC