Implement HTMLTemplateElement
authorrafaelw@chromium.org <rafaelw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2012 03:09:49 +0000 (03:09 +0000)
committerrafaelw@chromium.org <rafaelw@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2012 03:09:49 +0000 (03:09 +0000)
commit95df60aede322fd506f6d097e086e22a2b1ac06e
tree3a6475ff28b205254f5fb250a681d611d8df587f
parent34a6d3cdb1f5d5c55bacd5d4f8c3a35c92a5bd02
Implement HTMLTemplateElement
https://bugs.webkit.org/show_bug.cgi?id=86031

Reviewed by Adam Barth.

Source/WebCore:

Initial implementation. This patch includes the parser changes, new IDL and element implementation for <template>.

Spec: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html

Tests: fast/dom/HTMLTemplateElement/cloneNode.html
       fast/dom/HTMLTemplateElement/inertContents.html
       fast/dom/HTMLTemplateElement/innerHTML.html
       fast/dom/HTMLTemplateElement/ownerDocument.html
       html5lib/run-template.html

* WebCore.gypi:
* css/html.css:
(template):
* dom/Document.cpp:
(WebCore):
(WebCore::Document::templateContentsOwnerDocument):
* dom/Document.h:
(Document):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
* html/HTMLElement.h:
(HTMLElement):
* html/HTMLElementsAllInOne.cpp:
* html/HTMLTagNames.in:
* html/HTMLTemplateElement.cpp: Added.
(WebCore):
(WebCore::HTMLTemplateElement::HTMLTemplateElement):
(WebCore::HTMLTemplateElement::setInnerHTML):
(WebCore::HTMLTemplateElement::~HTMLTemplateElement):
(WebCore::HTMLTemplateElement::create):
(WebCore::HTMLTemplateElement::content):
(WebCore::HTMLTemplateElement::setContent):
(WebCore::toHTMLTemplateElement):
* html/HTMLTemplateElement.h: Added.
(WebCore):
(HTMLTemplateElement):
(WebCore::toHTMLTemplateElement):
* html/HTMLTemplateElement.idl: Added.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeTask):
(WebCore::HTMLConstructionSite::insertComment):
(WebCore::HTMLConstructionSite::insertTextNode):
(WebCore::HTMLConstructionSite::createElement):
(WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
(WebCore):
(WebCore::HTMLConstructionSite::createHTMLElement):
(WebCore::HTMLConstructionSite::findFosterSite):
* html/parser/HTMLConstructionSite.h:
(HTMLConstructionSite):
* html/parser/HTMLElementStack.cpp:
(WebCore):
(WebCore::HTMLElementStack::hasTemplateInHTMLScope):
* html/parser/HTMLElementStack.h:
(HTMLElementStack):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::constructTreeFromToken):
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore):
(WebCore::HTMLTreeBuilder::processTemplateEndTag):
(WebCore::HTMLTreeBuilder::processStartTagForInTable):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
(WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
(WebCore::HTMLTreeBuilder::processEndTagForInTableBody):
(WebCore::HTMLTreeBuilder::processEndTagForInRow):
(WebCore::HTMLTreeBuilder::processEndTagForInCell):
(WebCore::HTMLTreeBuilder::processEndTagForInBody):
(WebCore::HTMLTreeBuilder::processTrEndTagForInRow):
(WebCore::HTMLTreeBuilder::processTableEndTagForInTable):
(WebCore::HTMLTreeBuilder::processEndTag):
(WebCore::HTMLTreeBuilder::processCharacterBuffer):
(WebCore::HTMLTreeBuilder::processEndOfFile):
(WebCore::HTMLTreeBuilder::processStartTagForInHead):
* html/parser/HTMLTreeBuilder.h:
(HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::isParsingTemplateContents):
(WebCore::HTMLTreeBuilder::isParsingFragmentOrTemplateContents):
* page/DOMWindow.idl:

Source/WebKit/chromium:

Turning on HTMLTemplateElement for chromium port.

* features.gypi:

LayoutTests:

* fast/dom/HTMLTemplateElement/cloneNode-expected.txt: Added.
* fast/dom/HTMLTemplateElement/cloneNode.html: Added.
* fast/dom/HTMLTemplateElement/inertContents-expected.txt: Added.
* fast/dom/HTMLTemplateElement/inertContents.html: Added.
* fast/dom/HTMLTemplateElement/innerHTML-expected.txt: Added.
* fast/dom/HTMLTemplateElement/innerHTML.html: Added.
* fast/dom/HTMLTemplateElement/ownerDocument-expected.txt: Added.
* fast/dom/HTMLTemplateElement/ownerDocument.html: Added.
* html5lib/resources/template.dat: Added.
* html5lib/run-template-expected.txt: Added.
* html5lib/run-template.html: Added.
* resources/dump-as-markup.js:
(Markup._get):
(Markup._getSelectionFromNode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136467 268f45cc-cd09-0410-ab3c-d52691b4dbfc
50 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLTemplateElement/cloneNode-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLTemplateElement/cloneNode.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLTemplateElement/inertContents-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLTemplateElement/inertContents.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLTemplateElement/innerHTML-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLTemplateElement/innerHTML.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument.html [new file with mode: 0644]
LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML.xhtml [new file with mode: 0644]
LayoutTests/html5lib/resources/template.dat [new file with mode: 0644]
LayoutTests/html5lib/run-template-expected.txt [new file with mode: 0644]
LayoutTests/html5lib/run-template.html [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
LayoutTests/resources/dump-as-markup.js
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/html.css
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/editing/MarkupAccumulator.cpp
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElementsAllInOne.cpp
Source/WebCore/html/HTMLTagNames.in
Source/WebCore/html/HTMLTemplateElement.cpp [new file with mode: 0644]
Source/WebCore/html/HTMLTemplateElement.h [new file with mode: 0644]
Source/WebCore/html/HTMLTemplateElement.idl [new file with mode: 0644]
Source/WebCore/html/parser/HTMLConstructionSite.cpp
Source/WebCore/html/parser/HTMLConstructionSite.h
Source/WebCore/html/parser/HTMLElementStack.cpp
Source/WebCore/html/parser/HTMLElementStack.h
Source/WebCore/html/parser/HTMLTreeBuilder.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.h
Source/WebCore/page/DOMWindow.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/features.gypi
Tools/Scripts/webkitperl/FeatureList.pm