This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Non-normatively explain this. Also, whether nested template elements get a new document.
[Note: I'm going to make a separate bug for the "does each template get its own browser-context-less document or not" bug] This bug should resolve the following: Given a template with parsed contents, e.g. <body> <template> <div>Foo</div> </template> </body> specify the behavior of: -childNodes -firstChild -firstElementChild -appendChild -removeChild -innerHTML (set) -innerHTML (get)
[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 <script> by simply appending children to the template, but not affecting its content. Serializing a <template> which both direct children and content would result similarly to <script>. E.g. <script>var i = 1;</script> var i = document.getElementById('foo'); var div = i.appendChild(document.createElement('div')); div.innerHTML = 'bar'; i.innerHTML // var i = 1;<div>bar</div>
*** Bug 16788 has been marked as a duplicate of this bug. ***
this is now effectively covered in the introduction: http://dvcs.w3.org/hg/webcomponents/rev/69a61698173c