Properly process <template> end tags when in TemplateContentsMode
authoradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Dec 2012 00:09:20 +0000 (00:09 +0000)
committeradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Dec 2012 00:09:20 +0000 (00:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=105556

Reviewed by Eric Seidel.

Source/WebCore:

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processEndTag): Take care of the FIXME and just call
processTemplateEndTag() instead of incorrectly special-casing the end tag behavior in some cases.

LayoutTests:

* html5lib/resources/template.dat:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138315 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/html5lib/resources/template.dat
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLTreeBuilder.cpp

index d1107ba..86ee515 100644 (file)
@@ -1,3 +1,12 @@
+2012-12-20  Adam Klein  <adamk@chromium.org>
+
+        Properly process <template> end tags when in TemplateContentsMode
+        https://bugs.webkit.org/show_bug.cgi?id=105556
+
+        Reviewed by Eric Seidel.
+
+        * html5lib/resources/template.dat:
+
 2012-12-20  Emil A Eklund  <eae@chromium.org>
 
         [flexbox] Fix handling of very large flex grow/shrink values
index fdc249b..725b967 100644 (file)
 |         <tbody>
 |           <tr>
 |         <tfoot>
+
+#data
+<body><template><template><b><template></template></template>text</template>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <template>
+|       #document-fragment
+|         <template>
+|           #document-fragment
+|             <b>
+|               <template>
+|                 #document-fragment
+|         "text"
index f6b1f41..8800c02 100644 (file)
@@ -1,3 +1,14 @@
+2012-12-20  Adam Klein  <adamk@chromium.org>
+
+        Properly process <template> end tags when in TemplateContentsMode
+        https://bugs.webkit.org/show_bug.cgi?id=105556
+
+        Reviewed by Eric Seidel.
+
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::processEndTag): Take care of the FIXME and just call
+        processTemplateEndTag() instead of incorrectly special-casing the end tag behavior in some cases.
+
 2012-12-20  Kondapally Kalyan  <kalyan.kondapally@intel.com>
 
         [EFL][WebGL][Wk2] Replace HAVE(GLX) checks with USE(GLX)
index 2e524e4..f7d252d 100644 (file)
@@ -2283,12 +2283,8 @@ void HTMLTreeBuilder::processEndTag(AtomicHTMLToken* token)
         break;
     case TemplateContentsMode:
 #if ENABLE(TEMPLATE_ELEMENT)
-        // FIXME: https://www.w3.org/Bugs/Public/show_bug.cgi?id=19966
         if (token->name() == templateTag) {
-            ASSERT(m_tree.currentStackItem()->hasTagName(templateTag));
-            m_tree.openElements()->pop();
-            m_templateInsertionModes.removeLast();
-            resetInsertionModeAppropriately();
+            processTemplateEndTag(token);
             return;
         }
         setInsertionMode(InBodyMode);