[webcomponents] [Shadow]: We need comment about "scope" for shadow reference combinator. (bugzilla: 19685) (#248)

Title: [Shadow]: We need comment about "scope" for shadow reference combinator. (bugzilla: 19685)

Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=19685

----
comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=19685#c0
*Takashi Sakamoto* wrote on 2012-10-24 04:12:04 +0000.

The rule applicability algorithm in styles 7 works well to know whether some rule is applicable in the given TREE or not.

However, I think, we need some comments like:

- if RULE contains a select reference combinator and RULE is declared in shadow root style sheets:
  1. Let BOTTOM the shadow DOM subtree, with which these shadow root style sheets are associated

  2. If the shadow host of BOTTOM is in TREE, then RULE is applicable in TREE's children of shadow host whose shadow root has the shadow root style.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The reason why I need the comment is: 

Suppose that there are two divs in document tree. Each div has its own shadow dom subtree and shadow root stylesheets.

\<div id="host1">
   <#shadow-root\>
   \<style\>
   content /select/ div.special { color: red; }
   \</style\>
   \<content\>
   </#shadow-root\>
   \<div class="special">Comment 1\</div\>
\</div\>
\<div id="host2">
   <#shadow-root\>
   \<content\>
   </#shadow-root\>
   \<div class="special">Comment 2\</div\>
\</div\>

So looking at the shadow dom spec, the host1's 

   \<style\>
   content /select/ div.special { color: red; }
   \</style\>

is applicable in DOCUMENT tree. So "Comment 2" would be red colored?

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/248

Received on Monday, 6 July 2015 07:42:33 UTC