Index: Source/core/html/parser/HTMLTreeBuilder.cpp |
diff --git a/Source/core/html/parser/HTMLTreeBuilder.cpp b/Source/core/html/parser/HTMLTreeBuilder.cpp |
index 48f511cd276efdc40951896183fba287e9edccf4..ee860f1a0ffcd542e7a45daf48051fce68e0337f 100644 |
--- a/Source/core/html/parser/HTMLTreeBuilder.cpp |
+++ b/Source/core/html/parser/HTMLTreeBuilder.cpp |
@@ -36,6 +36,7 @@ |
#include "core/dom/DocumentFragment.h" |
#include "core/html/HTMLFormElement.h" |
#include "core/html/HTMLOptGroupElement.h" |
+#include "core/html/HTMLTableElement.h" |
#include "core/html/parser/AtomicHTMLToken.h" |
#include "core/html/parser/HTMLDocumentParser.h" |
#include "core/html/parser/HTMLParserIdioms.h" |
@@ -1620,7 +1621,7 @@ void HTMLTreeBuilder::resetInsertionModeAppropriately() |
if (item->hasTagName(colgroupTag)) { |
return setInsertionMode(InColumnGroupMode); |
} |
- if (item->hasTagName(tableTag)) |
+ if (isHTMLTableElement(item->node())) |
return setInsertionMode(InTableMode); |
if (item->hasTagName(headTag)) { |
if (!m_fragmentContext.fragment() || m_fragmentContext.contextElement() != item->node()) |
@@ -2330,7 +2331,7 @@ ReprocessBuffer: |
ASSERT(insertionMode() == InTableMode || insertionMode() == InTableBodyMode || insertionMode() == InRowMode); |
ASSERT(m_pendingTableCharacters.isEmpty()); |
if (m_tree.currentStackItem()->isElementNode() |
- && (m_tree.currentStackItem()->hasTagName(HTMLNames::tableTag) |
+ && (isHTMLTableElement(m_tree.currentStackItem()->node()) |
|| m_tree.currentStackItem()->hasTagName(HTMLNames::tbodyTag) |
|| m_tree.currentStackItem()->hasTagName(HTMLNames::tfootTag) |
|| m_tree.currentStackItem()->hasTagName(HTMLNames::theadTag) |