Title: [145566] branches/chromium/1410
Revision
145566
Author
[email protected]
Date
2013-03-12 11:18:39 -0700 (Tue, 12 Mar 2013)

Log Message

Merge 145293 "[HTMLTemplateElement] processTemplateEndTag() need..."

> [HTMLTemplateElement] processTemplateEndTag() needs to check for template in html scope
> https://bugs.webkit.org/show_bug.cgi?id=111880
> 
> Reviewed by Eric Seidel.
> 
> Source/WebCore:
> 
> Currently, </template> handling exits with an error if there is not a template tag "in scope"
> which will be true if there is a table (for instance) below a template. This makes it so that
> the search (correctly) examines the entire element stack.
> 
> Tests added to html5lib testing library.
> 
> * html/parser/HTMLTreeBuilder.cpp:
> (WebCore::HTMLTreeBuilder::processTemplateEndTag):
> 
> LayoutTests:
> 
> * html5lib/resources/template.dat:

[email protected]
Review URL: https://codereview.chromium.org/12623014

Modified Paths

Diff

Modified: branches/chromium/1410/LayoutTests/html5lib/resources/template.dat (145565 => 145566)


--- branches/chromium/1410/LayoutTests/html5lib/resources/template.dat	2013-03-12 18:13:50 UTC (rev 145565)
+++ branches/chromium/1410/LayoutTests/html5lib/resources/template.dat	2013-03-12 18:18:39 UTC (rev 145566)
@@ -1191,3 +1191,42 @@
 |             <style>
 |               "var i"
 |   <body>
+
+#data
+<template><table></template><body><span>Foo
+#errors
+#document
+| <html>
+|   <head>
+|     <template>
+|       content
+|         <table>
+|   <body>
+|     <span>
+|       "Foo"
+
+#data
+<template><td></template><body><span>Foo
+#errors
+#document
+| <html>
+|   <head>
+|     <template>
+|       content
+|         <td>
+|   <body>
+|     <span>
+|       "Foo"
+
+#data
+<template><object></template><body><span>Foo
+#errors
+#document
+| <html>
+|   <head>
+|     <template>
+|       content
+|         <object>
+|   <body>
+|     <span>
+|       "Foo"

Modified: branches/chromium/1410/Source/WebCore/html/parser/HTMLTreeBuilder.cpp (145565 => 145566)


--- branches/chromium/1410/Source/WebCore/html/parser/HTMLTreeBuilder.cpp	2013-03-12 18:13:50 UTC (rev 145565)
+++ branches/chromium/1410/Source/WebCore/html/parser/HTMLTreeBuilder.cpp	2013-03-12 18:18:39 UTC (rev 145566)
@@ -957,7 +957,8 @@
 
 void HTMLTreeBuilder::processTemplateEndTag(AtomicHTMLToken* token)
 {
-    if (!m_tree.openElements()->inScope(token->name())) {
+    if (!m_tree.openElements()->hasTemplateInHTMLScope()) {
+        ASSERT(m_templateInsertionModes.isEmpty());
         parseError(token);
         return;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to