[shadow-styling] clarify role of the `active shadow tree`

This section (http://dev.w3.org/csswg/shadow-styling/#shadow-trees) defines
the `active shadow tree`, but the spec does not mention the importance this
has for styling. The spec does say,

"The descendants of a shadow host must not generate boxes as normal.
Instead, the contents of the active shadow tree generates boxes as if it
were the contents of the element instead."

It's unclear to me if "generate boxes" is connected with the application of
a stylesheet. Regardless, the spec needs to clarify the following behavior.

Only stylesheets in the `active shadow tree` should be applied. The
ShadomDOM spec defines the <shadow> element (
http://w3c.github.io/webcomponents/spec/shadow/#the-shadow-element). By
using a <shadow> element inside a younger shadowRoot, an author can choose
to display an older shadowRoot. It's only in this case that stylesheets in
an older shadowRoot should be applied.

This is important to clarify because it has implications for the :host
selector. If an element has 2 shadowRoots and the older shadowRoot includes
a stylesheet with a :host selector, this rule should only be applied if the
younger active shadowRoot includes a <shadow> element.

This behavior is desirable because it allows style information to be
isolated between shadowRoots. It also gives authors a choice (via the
<shadow> element) to accept or reject :host styling defined in older
shadowRoots.

Received on Friday, 14 March 2014 17:01:56 UTC