- From: <bugzilla@jessica.w3.org>
- Date: Mon, 02 Jul 2012 10:56:27 +0000
- To: public-webapps-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17590 --- Comment #3 from Takashi Sakamoto <tasak@google.com> 2012-07-02 10:56:42 UTC --- (In reply to comment #1) > (In reply to comment #0) > > What is the meaning of > > > > <style scoped> > > @host { ... } > > </style> > > > > in a shadow tree? > > Right now, it's not mentioned that "scoped" affects anything, so I assumed that > it's clear that @host only affects the shadow host, regardless of the value. I would like to ask how to find matched scoped styles which contain @host rules. For example, there is some HTML document like: <div id="host"> <div id="child-a"></div> <div id="child-b"></div> </div> and a shadow root (attached to the div whose id is "host") is <div> <style scoped> @host { color: red } </style> <content select=":first-child"></content> </div> <div> <style scoped> @host { color: blue } </style> <content></content> </div> We have to go up a DOM tree to find matched styles. So to find child-a or child-b's style, we will go up the following tree: host------------------#shadow-root... | +----child-a | +----child-b If we have no @host rules, it is ok to look at child-a and host node to find child-a's matched styles. However, if the above "scoped" works, I think, we have to traverse in the following way: host | +----#shadow-root | +-----div (has scoped @host rule) | +----- child-a (color: red) Talking about child-b, host | +----#shadow-root | +-----div (has scoped @host rule) | +----- child-b (color: blue) If we cannot make @host rules "scoped", host (color: blue) | +----child-a host (color: blue) | +----child-b (in this case, we cannot change the color of child-b.) I'm not sure which is better for web developers. However according to an idea of @host rules, i.e. web developers can change styles of host nodes, I think, they want to change styles per <content> (or <shadow>). Best regards, Takashi Sakamoto -- Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug.
Received on Monday, 2 July 2012 10:56:48 UTC