HTML parser instantiates a custom element inside a template element with a wrong...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2016 01:20:56 +0000 (01:20 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Mar 2016 01:20:56 +0000 (01:20 +0000)
commit70963225a8e0a48e8701b9a30768a01b6b6264dc
tree8f7d5c2baae9fcd9c953aa75fb1cb88097cf39f8
parent5e1ac70e35e788fe79f253316ed12d930635c123
HTML parser instantiates a custom element inside a template element with a wrong owner document
https://bugs.webkit.org/show_bug.cgi?id=154936

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Updated the expected results for newly passing test cases.

One test case in additions-to-parsing-xhtml-documents/node-document.html starts failing due to a bug in the test.
The bug in the test will be fixed in https://github.com/w3c/web-platform-tests/pull/2651

Finally, remove duplicated HTML template element tests in html-templates since there is a new copy under
web-platform-tests/html/semantics/scripting-1/the-template-element/. Unfortunately, we can't remove
html-templates/parsing-html-templates/ because we haven't imported web-platform-tests/html/syntax yet.

* html-templates/additions-to-parsing-xhtml-documents: Removed.
* html-templates/additions-to-serializing-xhtml-documents: Removed.
* html-templates/additions-to-the-css-user-agent-style-sheet: Removed.
* html-templates/additions-to-the-steps-to-clone-a-node: Removed.
* html-templates/definitions: Removed.
* html-templates/innerhtml-on-templates: Removed.
* html-templates/serializing-html-templates: Removed.
* html-templates/template-element: Removed.
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-001-expected.txt:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/node-document-changes-expected.txt:

Source/WebCore:

The bug was caused by our implementation following the old spec which didn't create a appropriate template
contents owner document [1] for a document without a browsing context. The new spec no longer has this clause,
and we should be always creating the appropriate template contents owner document unless the document itself
is an appropriate template contents owner document for another document (comes up in nested template elements).

No new tests since the behavior change is covered by existing tests.

[1] https://html.spec.whatwg.org/#appropriate-template-contents-owner-document

* dom/Document.h:
(WebCore::Document::templateDocument):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@197481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
50 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/html-templates/additions-to-parsing-xhtml-documents/node-document-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-parsing-xhtml-documents/node-document.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-parsing-xhtml-documents/template-child-nodes-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-parsing-xhtml-documents/template-child-nodes.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-serializing-xhtml-documents/outerhtml-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-serializing-xhtml-documents/outerhtml.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001-expected.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-001.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002-expected.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-002.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003-expected.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-css-user-agent-style-sheet/css-user-agent-style-sheet-test-003.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-steps-to-clone-a-node/template-clone-children-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-steps-to-clone-a-node/template-clone-children.html [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner.html [deleted file]
LayoutTests/imported/w3c/html-templates/definitions/template-contents-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/definitions/template-contents-owner-document-type-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/definitions/template-contents-owner-document-type.html [deleted file]
LayoutTests/imported/w3c/html-templates/definitions/template-contents-owner-test-001-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/definitions/template-contents-owner-test-001.html [deleted file]
LayoutTests/imported/w3c/html-templates/definitions/template-contents-owner-test-002-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/definitions/template-contents-owner-test-002.html [deleted file]
LayoutTests/imported/w3c/html-templates/definitions/template-contents.html [deleted file]
LayoutTests/imported/w3c/html-templates/innerhtml-on-templates/innerhtml-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/innerhtml-on-templates/innerhtml.html [deleted file]
LayoutTests/imported/w3c/html-templates/serializing-html-templates/outerhtml-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/serializing-html-templates/outerhtml.html [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/content-attribute-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/content-attribute.html [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/node-document-changes-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/node-document-changes.html [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-as-a-descendant-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-as-a-descendant.html [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-content-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-content-node-document-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-content-node-document.html [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-content.html [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-descendant-body-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-descendant-body.html [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-descendant-frameset-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-descendant-frameset.html [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-descendant-head-expected.txt [deleted file]
LayoutTests/imported/w3c/html-templates/template-element/template-descendant-head.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-001-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/node-document-changes-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.h