<?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>16280</bug_id>
          
          <creation_ts>2012-03-08 23:35:38 +0000</creation_ts>
          <short_desc>[Templates]: [Non-normative] Clarify the behavior of Node/Element mutation, traversal &amp; serialize/deserialize APIs on &lt;template&gt;</short_desc>
          <delta_ts>2012-10-04 20:50:10 +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>erik.arvidsson</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>65179</commentid>
    <comment_count>0</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-03-08 23:35:38 +0000</bug_when>
    <thetext>Non-normatively explain this. Also, whether nested template elements get a new document.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72299</commentid>
    <comment_count>1</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-08-16 17:29:32 +0000</bug_when>
    <thetext>[Note: I&apos;m going to make a separate bug for the &quot;does each template get its own browser-context-less document or not&quot; bug]

This bug should resolve the following:

Given a template with parsed contents, e.g.

&lt;body&gt;
  &lt;template&gt;
    &lt;div&gt;Foo&lt;/div&gt;
  &lt;/template&gt;
&lt;/body&gt;

specify the behavior of:

-childNodes
-firstChild
-firstElementChild
-appendChild
-removeChild
-innerHTML (set)
-innerHTML (get)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72300</commentid>
    <comment_count>2</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-08-16 17:37:31 +0000</bug_when>
    <thetext>[editorial]

So my feeling is that the tricky part of this is that given that a template deserializes by lifting elements into its content DF, it stands to reason that the reverse would be true. E.g. It seems desireable to retain the following:



document.documentElement.innerHTML = myMarkupString;
var output = document.documentElement.innerHTML;
assert(output == myMarkupString).

This suggests to me that template.innerHTML should parse the markup using implied context parsing, and
replace its content DF with the resulting DOM.

---

I think that childNodes, appendChild, etc... should not delegate to the content DF. E.g. though would behave much like &lt;script&gt; by simply appending children to the template, but not affecting its content.

Serializing a &lt;template&gt; which both direct children and content would result similarly to &lt;script&gt;. E.g.

&lt;script&gt;var i = 1;&lt;/script&gt;

var i = document.getElementById(&apos;foo&apos;);
var div = i.appendChild(document.createElement(&apos;div&apos;));
div.innerHTML = &apos;bar&apos;;
i.innerHTML // var i = 1;&lt;div&gt;bar&lt;/div&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72309</commentid>
    <comment_count>3</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-08-16 18:37:16 +0000</bug_when>
    <thetext>*** Bug 16788 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75318</commentid>
    <comment_count>4</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2012-10-04 20:50:10 +0000</bug_when>
    <thetext>this is now effectively covered in the introduction:

http://dvcs.w3.org/hg/webcomponents/rev/69a61698173c</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>