<?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>23795</bug_id>
          
          <creation_ts>2013-11-11 21:20:51 +0000</creation_ts>
          <short_desc>Template elements with the same ownerDocument should share a single contents ownerDocument</short_desc>
          <delta_ts>2013-11-12 22:14:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Klein">adamk</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>rafaelw</cc>
    
    <cc>wchen</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>96143</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2013-11-11 21:20:51 +0000</bug_when>
    <thetext>The algorithm for creating the content DocumentFragment of templates (http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#template-contents) says in step 2.1 to always create a new Document. But this is not what Gecko or Blink do. The following code returns true on both those engines:

t1 = document.createElement(&apos;template&apos;);
t2 = document.createElement(&apos;template&apos;);
t.content.ownerDocument === t2.content.ownerDocument</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96145</commentid>
    <comment_count>1</comment_count>
    <who name="William Chen">wchen</who>
    <bug_when>2013-11-11 21:28:16 +0000</bug_when>
    <thetext>It seems like the concept of &quot;template contents owner&quot; didn&apos;t get carried over from the old spec.

https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#definitions</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96198</commentid>
    <comment_count>2</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2013-11-12 20:26:51 +0000</bug_when>
    <thetext>Yep. I probably missed this when reviewin Hixie&apos;s changes from the stand-alone spec. Apologies. Adam is correct: The original spec (plus WebKit/Blink/Gecko) intentionally avoids creating tons of documents to host template contents.

The stand-along spec used the term &quot;template contents owner doc&quot;:

https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#dfn-template-contents-owner

These steps attempt to create the situation where there is at most one owning document per displayed document which contains templates.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96202</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-12 21:36:46 +0000</bug_when>
    <thetext>Huh, that totally went over my head. I didn&apos;t realise the implications of how that was defined. My bad. Fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96203</commentid>
    <comment_count>4</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-11-12 21:36:57 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8270.
Check-in comment: Share the ownerDocument of template contents amongst the templates of a document.
http://html5.org/tools/web-apps-tracker?from=8269&amp;to=8270</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96212</commentid>
    <comment_count>5</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2013-11-12 22:14:29 +0000</bug_when>
    <thetext>lgtm. thanks, hixie.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>