[HTMLTemplateElement] processTemplateEndTag() needs to check for template in html...
[WebKit-https.git] / Source / WebCore / html / parser / HTMLTreeBuilder.cpp
index f0072d5..b1d0293 100644 (file)
@@ -958,7 +958,8 @@ void HTMLTreeBuilder::processTemplateStartTag(AtomicHTMLToken* token)
 
 void HTMLTreeBuilder::processTemplateEndTag(AtomicHTMLToken* token)
 {
-    if (!m_tree.openElements()->inScope(token->name())) {
+    if (!m_tree.openElements()->hasTemplateInHTMLScope()) {
+        ASSERT(m_templateInsertionModes.isEmpty());
         parseError(token);
         return;
     }