<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20150</bug_id>
          
          <creation_ts>2012-11-29 08:32:00 +0000</creation_ts>
          <short_desc>[Shadow]: &quot;Nested tree&quot; is defined, but &quot;nesting tree&quot; is only implied</short_desc>
          <delta_ts>2013-02-01 10:22:27 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>18428</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sergey G. Grekhov">sgrekhov</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>bugs</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>79095</commentid>
    <comment_count>0</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-11-29 08:32:00 +0000</bug_when>
    <thetext>There&apos;s a contradiction in @host @-rule matching criteria. Here https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles specification reads:

&quot;The @host @-rule matches a shadow host in the nesting tree.&quot;

But below https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#host-at-rule there are the following:

&quot;The declarations of the rules in a @host @-rule must only be matched against the shadow host of the shadow tree in which the style is specified&quot;

So this is a contradiction. If there&apos;s a shadow tree containing the nested tree should @host rule be applied to the nested tree or to the shadow tree itself only?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79657</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-12-07 18:39:08 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; There&apos;s a contradiction in @host @-rule matching criteria. Here
&gt; https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.
&gt; html#styles specification reads:
&gt; 
&gt; &quot;The @host @-rule matches a shadow host in the nesting tree.&quot;
&gt; 
&gt; But below
&gt; https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.
&gt; html#host-at-rule there are the following:
&gt; 
&gt; &quot;The declarations of the rules in a @host @-rule must only be matched
&gt; against the shadow host of the shadow tree in which the style is specified&quot;
&gt; 
&gt; So this is a contradiction. If there&apos;s a shadow tree containing the nested
&gt; tree should @host rule be applied to the nested tree or to the shadow tree
&gt; itself only?

Ah! I think I know what the problem is. I started using the term &quot;nesting tree&quot; as the opposite of &quot;nested tree&quot; but never captured this in writing. I think you&apos;re reading &quot;nesting&quot; and &quot;nested&quot; as being the same thing and thus seeing a contradiction. Let me fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79660</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-12-07 19:01:29 +0000</bug_when>
    <thetext>http://dvcs.w3.org/hg/webcomponents/rev/1c3901041ed5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79813</commentid>
    <comment_count>3</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-12-10 06:47:28 +0000</bug_when>
    <thetext>Now it&apos;s clear thank you. But... I was unable to create working @host @-rule. I&apos;m not sure if this is an implementation issue or I was wrong in the syntaxis. An example of how @host rule should work would be very helpful.

That&apos;s what I tried:

var d = document;

    d.body.innerHTML = 
    	&apos;&lt;ul class=&quot;cls&quot;&gt;&apos; +
    		&apos;&lt;li id=&quot;li1&quot; class=&quot;shadow&quot;&gt;1&lt;/li&gt;&apos; +
    		&apos;&lt;li id=&quot;li2&quot; class=&quot;shadow2&quot;&gt;2&lt;/li&gt;&apos; +
    		&apos;&lt;li id=&quot;li3&quot; class=&quot;shadow&quot;&gt;3&lt;/li&gt;&apos; +
    		&apos;&lt;li id=&quot;li4&quot;&gt;4&lt;/li&gt;&apos; +
    		&apos;&lt;li id=&quot;li5&quot; class=&quot;shadow&quot;&gt;5&lt;/li&gt;&apos; +
    		&apos;&lt;li id=&quot;li6&quot; class=&quot;shadow2&quot;&gt;6&lt;/li&gt;&apos; +
    	&apos;&lt;/ul&gt;&apos;;

    var host = d.querySelector(&apos;.cls&apos;);
    //Shadow root to play with
    var s = new SR(host);
	
    var div = d.createElement(&apos;div&apos;);	
    div.innerHTML =&apos;&lt;ul&gt;&lt;content select=&quot;.shadow&quot;&gt;&lt;/content&gt;&lt;/ul&gt;&apos;; 
    s.appendChild(div);	
		
   var style = d.createElement(&apos;style&apos;);
   style.innerHTML = &apos;&apos; + 
			&apos;@host {&apos; +
				&apos;ul {display:none;}&apos; +
			&apos;}&apos;;
   s.appendChild(style);


What should be correct @host rule that makes shadow host content invisible?
I also tried
			&apos;@host {&apos; +
				&apos;div {display:none;}&apos; +
			&apos;}&apos;;

But this don&apos;t work anyway. So, please, add the example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79816</commentid>
    <comment_count>4</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2012-12-10 09:23:08 +0000</bug_when>
    <thetext>Forgot to add that I really read &apos;nesting&apos; as &apos;nested&apos; at first...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82465</commentid>
    <comment_count>5</comment_count>
    <who name="Sergey G. Grekhov">sgrekhov</who>
    <bug_when>2013-02-01 09:44:25 +0000</bug_when>
    <thetext>Works in Chrome Canary. Closed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82466</commentid>
    <comment_count>6</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2013-02-01 10:22:27 +0000</bug_when>
    <thetext>That is not a reason to close a spec bug.
Is the spec ok now?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>