<?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>16341</bug_id>
          
          <creation_ts>2012-03-12 22:35:50 +0000</creation_ts>
          <short_desc>[Templates]: [Non-normative] Clarify that template contents cannot be matched against &quot;selector&quot; queries in their host documents.</short_desc>
          <delta_ts>2012-10-04 20:51:01 +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>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>15476</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dimitri Glazkov">dglazkov</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>dglazkov</cc>
    
    <cc>dominicc</cc>
    
    <cc>rafaelw</cc>
    
    <cc>tross</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>65419</commentid>
    <comment_count>0</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-03-12 22:35:50 +0000</bug_when>
    <thetext>Raf: You don&apos;t mention the goal of isolating template contents from &quot;find&quot;
methods of the containing document, e.g.
document.querySelector/getElementById, CSS rules.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72305</commentid>
    <comment_count>1</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-08-16 18:33:54 +0000</bug_when>
    <thetext>E.g.

document.getElementByTagName(&quot;div&quot;) won&apos;t match div.id == &apos;foo&apos;.

&lt;template&gt;
  &lt;div id=&quot;foo&quot;&gt;
&lt;/template&gt;

this applies to getElementById, querySelector, querySelectorAll, getElementsByTagName, etc...

One challenge this presents is that DocumentFragment doesn&apos;t hvave th</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72307</commentid>
    <comment_count>2</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-08-16 18:35:33 +0000</bug_when>
    <thetext>[continued]

One challenge is that while DocumentFragment does have querySelector(All), it doesn&apos;t have getElement(s)By*. I don&apos;t see why it couldn&apos;t, but it doesn&apos;t currently.

I&apos;m actually ok with this. querySelectorAll is sufficient for any need. I&apos;m happy filing bugs to add more API to DF later if need be.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72311</commentid>
    <comment_count>3</comment_count>
    <who name="Tony Ross [MSFT]">tross</who>
    <bug_when>2012-08-16 18:41:24 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; [continued]
&gt; 
&gt; One challenge is that while DocumentFragment does have querySelector(All), it
&gt; doesn&apos;t have getElement(s)By*. I don&apos;t see why it couldn&apos;t, but it doesn&apos;t
&gt; currently.
&gt; 
&gt; I&apos;m actually ok with this. querySelectorAll is sufficient for any need. I&apos;m
&gt; happy filing bugs to add more API to DF later if need be.

I&apos;d favor enhancing DocumentFragment itself (so sounds like a good bug for DOM4). This would also remove the need to separately declare getElementById and friends on the ShadowRoot interface in the Shadom DOM spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72313</commentid>
    <comment_count>4</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-08-16 18:48:00 +0000</bug_when>
    <thetext>So I just asked Ojan about this and the reasoning that this hasn&apos;t been done yet is that getElementsBy* return live node lists while querySelectorAll returns a static node list, which is preferred now. So basically, the sentiment is to encourage the use of querySelector* vs getElementsBy*. I&apos;m fine with this. I suppose we could add getElementById if we thought it was really important.

Obviously, everything can be accomplished with selectors, but that&apos;s not obvious to alot of webdevs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72314</commentid>
    <comment_count>5</comment_count>
    <who name="Tony Ross [MSFT]">tross</who>
    <bug_when>2012-08-16 18:53:08 +0000</bug_when>
    <thetext>That makes sense, though if that&apos;s the sentiment should we instead have a bug to remove these APIs from ShadowRoot?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72316</commentid>
    <comment_count>6</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-08-16 19:06:55 +0000</bug_when>
    <thetext>Yep. Probably. +dimitri &amp; dominic</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72317</commentid>
    <comment_count>7</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-08-16 19:16:28 +0000</bug_when>
    <thetext>Yup: https://www.w3.org/Bugs/Public/show_bug.cgi?id=16904</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75319</commentid>
    <comment_count>8</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-10-04 20:51:01 +0000</bug_when>
    <thetext>http://dvcs.w3.org/hg/webcomponents/rev/69a61698173c</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>