So I wrote the following code for an article I am writing: http://codepen.io/anon/pen/dPeYGN (Which is just a clean up of something I posted here).
Scoping through the shadow
Having selectors from the outside looking through a shadow DOM route I would expect the above code to not be all in red.
my-element {
color: red;
}
Rendered HTML DOM nodes:
<my-element>
<"shadow-tree">
<span>My title</span>
<content>
<span>My content</span>
</content>
</>
</my-element>
I would not expect “My title” to be in red text.
Scoped styles
In both CSS scoping and Shadow DOM there seems to now be a lack of wording around scoped styling within the shadow DOM.
So given:
<div>
<"shadow-tree">
<b>Text 1</b>
<style>
b { color: purple; }
</style>
</>
</div>
<b>Text 2</b>
“Text 1” should only be purple right?
I do remember reading that a <style>
within a shadow tree behaves the same way as a <style scoped>
however given that implementers are removing support for that I assume that is why the wording got dropped. However I think it would be good to be specific that the styles register on the ShadowRoute.StyleSheetList
scoped to only this tree and not the document.
I assume @tabatkins will know the current behaviour of these two examples.