Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1175)

Unified Diff: Source/core/html/parser/HTMLElementStack.cpp

Issue 19098002: Introduce isHTMLHtmlElement and toHTMLHtmlElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/PluginDocument.cpp ('k') | Source/core/html/parser/HTMLTreeBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLElementStack.cpp
diff --git a/Source/core/html/parser/HTMLElementStack.cpp b/Source/core/html/parser/HTMLElementStack.cpp
index 1c2e2fa4091c846b82202755ae0203f879837d3c..8953dbd5b1f3347f06ff77a261292309c15f9ce4 100644
--- a/Source/core/html/parser/HTMLElementStack.cpp
+++ b/Source/core/html/parser/HTMLElementStack.cpp
@@ -31,6 +31,7 @@
#include "MathMLNames.h"
#include "SVGNames.h"
#include "core/dom/Element.h"
+#include "core/html/HTMLHtmlElement.h"
#include "core/html/HTMLOptGroupElement.h"
#include "core/html/HTMLTableElement.h"
#include <wtf/PassOwnPtr.h>
@@ -45,7 +46,7 @@ namespace {
inline bool isRootNode(HTMLStackItem* item)
{
return item->isDocumentFragmentNode()
- || item->hasTagName(htmlTag);
+ || isHTMLHtmlElement(item->node());
}
inline bool isScopeMarker(HTMLStackItem* item)
@@ -309,7 +310,7 @@ void HTMLElementStack::pushRootNode(PassRefPtr<HTMLStackItem> rootItem)
void HTMLElementStack::pushHTMLHtmlElement(PassRefPtr<HTMLStackItem> item)
{
- ASSERT(item->hasTagName(HTMLNames::htmlTag));
+ ASSERT(isHTMLHtmlElement(item->node()));
pushRootNodeCommon(item);
}
@@ -339,7 +340,7 @@ void HTMLElementStack::pushHTMLBodyElement(PassRefPtr<HTMLStackItem> item)
void HTMLElementStack::push(PassRefPtr<HTMLStackItem> item)
{
- ASSERT(!item->hasTagName(HTMLNames::htmlTag));
+ ASSERT(!isHTMLHtmlElement(item->node()));
ASSERT(!item->hasTagName(HTMLNames::headTag));
ASSERT(!item->hasTagName(HTMLNames::bodyTag));
ASSERT(m_rootNode);
@@ -351,7 +352,7 @@ void HTMLElementStack::insertAbove(PassRefPtr<HTMLStackItem> item, ElementRecord
ASSERT(item);
ASSERT(recordBelow);
ASSERT(m_top);
- ASSERT(!item->hasTagName(HTMLNames::htmlTag));
+ ASSERT(!isHTMLHtmlElement(item->node()));
ASSERT(!item->hasTagName(HTMLNames::headTag));
ASSERT(!item->hasTagName(HTMLNames::bodyTag));
ASSERT(m_rootNode);
@@ -566,7 +567,7 @@ void HTMLElementStack::pushCommon(PassRefPtr<HTMLStackItem> item)
void HTMLElementStack::popCommon()
{
- ASSERT(!topStackItem()->hasTagName(HTMLNames::htmlTag));
+ ASSERT(!isHTMLHtmlElement(topStackItem()->node()));
ASSERT(!topStackItem()->hasTagName(HTMLNames::headTag) || !m_headElement);
ASSERT(!topStackItem()->hasTagName(HTMLNames::bodyTag) || !m_bodyElement);
top()->finishParsingChildren();
@@ -577,7 +578,7 @@ void HTMLElementStack::popCommon()
void HTMLElementStack::removeNonTopCommon(Element* element)
{
- ASSERT(!element->hasTagName(HTMLNames::htmlTag));
+ ASSERT(!isHTMLHtmlElement(element));
ASSERT(!element->hasTagName(HTMLNames::bodyTag));
ASSERT(top() != element);
for (ElementRecord* pos = m_top.get(); pos; pos = pos->next()) {
« no previous file with comments | « Source/core/html/PluginDocument.cpp ('k') | Source/core/html/parser/HTMLTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698