[HTMLTemplateElement] prevent the parser from removing nodes from the content when...
authorrafaelw@chromium.org <rafaelw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2013 23:11:52 +0000 (23:11 +0000)
committerrafaelw@chromium.org <rafaelw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2013 23:11:52 +0000 (23:11 +0000)
commit7908446e6fb91940fe859436cd1505833624004c
tree70f4e9a2c74be3aeaaa6b206a850ab681c0d3519
parent59a6ac56ce3a5ca5a863587a79974aa52271e69e
[HTMLTemplateElement] prevent the parser from removing nodes from the content when the foster agency is processing formatting elements
https://bugs.webkit.org/show_bug.cgi?id=108377

Reviewed by Adam Barth.

Source/WebCore:

https://dvcs.w3.org/hg/webcomponents/raw-file/50ce1f368c1a/spec/templates/index.html#in-body-addition

callTheAdoptionAgency now appends to the template's content when it previously would have appended to the template element itself.

New test added to html5lib.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::parserInsertBefore):
(WebCore::ContainerNode::parserAppendChild):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):

LayoutTests:

Note that dump-as-markup.js is modified here to put both template content and its direct children. This was an oversight and fixing it will make it
easier to spot parse errors like ones that arise from this bug, where nodes are appended directly to the template element.

* html5lib/resources/template.dat:
* resources/dump-as-markup.js:
(Markup._get):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/html5lib/resources/template.dat
LayoutTests/resources/dump-as-markup.js
Source/WebCore/ChangeLog
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.cpp