Title: [147185] trunk
Revision
147185
Author
rafa...@chromium.org
Date
2013-03-28 17:13:05 -0700 (Thu, 28 Mar 2013)

Log Message

[HTMLTemplateElement] <template> should be able to be a foster parent
https://bugs.webkit.org/show_bug.cgi?id=113541

Source/WebCore:

Reviewed by Eric Seidel

This adds to the check in findFosterSite to include whether the parent is a DocumentFragment which is a template contents.

Tests added to html5lib suite.

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::findFosterSite):

LayoutTests:

Reviewed by Eric Seidel.

* html5lib/resources/template.dat:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (147184 => 147185)


--- trunk/LayoutTests/ChangeLog	2013-03-29 00:09:56 UTC (rev 147184)
+++ trunk/LayoutTests/ChangeLog	2013-03-29 00:13:05 UTC (rev 147185)
@@ -1,3 +1,12 @@
+2013-03-28  Rafael Weinstein  <rafa...@chromium.org>
+
+        [HTMLTemplateElement] <template> should be able to be a foster parent
+        https://bugs.webkit.org/show_bug.cgi?id=113541
+
+        Reviewed by Eric Seidel.
+
+        * html5lib/resources/template.dat:
+
 2013-03-28  Tony Chang  <t...@chromium.org>
 
         Convert some flexbox layout tests to using flexbox.css

Modified: trunk/LayoutTests/html5lib/resources/template.dat (147184 => 147185)


--- trunk/LayoutTests/html5lib/resources/template.dat	2013-03-29 00:09:56 UTC (rev 147184)
+++ trunk/LayoutTests/html5lib/resources/template.dat	2013-03-29 00:13:05 UTC (rev 147185)
@@ -1146,8 +1146,8 @@
 |       content
 |         <template>
 |           content
+|             "Foo"
 |             <table>
-|             "Foo"
 |   <body>
 
 #data

Modified: trunk/Source/WebCore/ChangeLog (147184 => 147185)


--- trunk/Source/WebCore/ChangeLog	2013-03-29 00:09:56 UTC (rev 147184)
+++ trunk/Source/WebCore/ChangeLog	2013-03-29 00:13:05 UTC (rev 147185)
@@ -1,3 +1,17 @@
+2013-03-28  Rafael Weinstein  <rafa...@chromium.org>
+
+        [HTMLTemplateElement] <template> should be able to be a foster parent
+        https://bugs.webkit.org/show_bug.cgi?id=113541
+
+        Reviewed by Eric Seidel
+
+        This adds to the check in findFosterSite to include whether the parent is a DocumentFragment which is a template contents.
+
+        Tests added to html5lib suite.
+
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::findFosterSite):
+
 2013-03-28  Xianzhu Wang  <wangxian...@chromium.org>
 
         [Chromium] Don't create SolidColorLayer for full transparent background

Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (147184 => 147185)


--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp	2013-03-29 00:09:56 UTC (rev 147184)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp	2013-03-29 00:13:05 UTC (rev 147185)
@@ -629,7 +629,11 @@
         ContainerNode* parent = lastTableElement->parentNode();
         // When parsing HTML fragments, we skip step 4.2 ("Let root be a new html element with no attributes") for efficiency,
         // and instead use the DocumentFragment as a root node. So we must treat the root node (DocumentFragment) as if it is a html element here.
-        if (parent && (parent->isElementNode() || (m_isParsingFragment && parent == m_openElements.rootNode()))) {
+        bool parentCanBeFosterParent = parent && (parent->isElementNode() || (m_isParsingFragment && parent == m_openElements.rootNode()));
+#if ENABLE(TEMPLATE_ELEMENT)
+        parentCanBeFosterParent = parentCanBeFosterParent || (parent && parent->isDocumentFragment() && static_cast<DocumentFragment*>(parent)->isTemplateContent());
+#endif
+        if (parentCanBeFosterParent) {
             task.parent = parent;
             task.nextChild = lastTableElement;
             return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to