<?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>25561</bug_id>
          
          <creation_ts>2014-05-05 20:22:56 +0000</creation_ts>
          <short_desc>[Explainer]: Use of template in example would result in multiple matching ID tags being generated in the DOM</short_desc>
          <delta_ts>2014-05-06 14:32:15 +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>WONTFIX</resolution>
          
          
          <bug_file_loc>http://w3c.github.io/webcomponents/explainer/#lifecycle-callbacks</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>14949</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Denny Caldwell">dcaldwell</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>jonas</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105070</commentid>
    <comment_count>0</comment_count>
    <who name="Denny Caldwell">dcaldwell</who>
    <bug_when>2014-05-05 20:22:56 +0000</bug_when>
    <thetext>In the &quot;tick-tock-clock-template&quot; example, id tags are used inside of the template. The intended use of this code is to make a reusable component, but reusing this template would result in multiple &quot;hh&quot;, &quot;sep&quot; and &quot;mm&quot; tags being inserted into the DOM - something that breaks HTML standards. A fix would be to instead use another attribute, such as class.

So this:

&lt;template id=&quot;tick-tock-clock-template&quot;&gt;
  &lt;span id=&quot;hh&quot;&gt;&lt;/span&gt;
  &lt;span id=&quot;sep&quot;&gt;:&lt;/span&gt;
  &lt;span id=&quot;mm&quot;&gt;&lt;/span&gt;
&lt;/template&gt;

...becomes this:

&lt;template id=&quot;tick-tock-clock-template&quot;&gt;
  &lt;span class=&quot;hh&quot;&gt;&lt;/span&gt;
  &lt;span class=&quot;sep&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;mm&quot;&gt;&lt;/span&gt;
&lt;/template&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105072</commentid>
    <comment_count>1</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2014-05-05 20:39:08 +0000</bug_when>
    <thetext>I definitely don&apos;t think that Shadow content should end up in the document&apos;s id map. I.e. document.getElementById(x) should never return an element that is in Shadow DOM.

We really have to remove the &quot;All other HTML elements in the shadow trees must behave as if they were part of the document tree&quot; language from the Shadow DOM spec. That&apos;s not nearly normative enough. Simply setting the &quot;in document&quot; flag will mean different things in different engines.

I&apos;ve raised this before and I&apos;m not sure if the fix is still in progress or if people simply disagree. I&apos;ve not heard anything back yet either way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105076</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2014-05-05 21:02:59 +0000</bug_when>
    <thetext>(In reply to Jonas Sicking from comment #1)
&gt; I definitely don&apos;t think that Shadow content should end up in the document&apos;s
&gt; id map. I.e. document.getElementById(x) should never return an element that
&gt; is in Shadow DOM.

Right. Denny, as Jonas points out, the ids will be in a shadow tree of the element, which means that they will never collide with main document or other instances.

&gt; 
&gt; We really have to remove the &quot;All other HTML elements in the shadow trees
&gt; must behave as if they were part of the document tree&quot; language from the
&gt; Shadow DOM spec. That&apos;s not nearly normative enough. Simply setting the &quot;in
&gt; document&quot; flag will mean different things in different engines.
&gt; 
&gt; I&apos;ve raised this before and I&apos;m not sure if the fix is still in progress or
&gt; if people simply disagree. I&apos;ve not heard anything back yet either way.

Filed bug 25562.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105176</commentid>
    <comment_count>3</comment_count>
    <who name="Denny Caldwell">dcaldwell</who>
    <bug_when>2014-05-06 12:41:24 +0000</bug_when>
    <thetext>Will they also not collide with ID&apos;s of other elements in the shadow DOM?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105186</commentid>
    <comment_count>4</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2014-05-06 14:32:15 +0000</bug_when>
    <thetext>(In reply to Denny Caldwell from comment #3)
&gt; Will they also not collide with ID&apos;s of other elements in the shadow DOM?

Sure, but there aren&apos;t any other IDs in those shadow trees.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>