summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkouhei <kouhei@chromium.org>2015-10-19 18:21:11 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-20 01:21:47 +0000
commiteaa987d5ea129080597e7e537a5037eea213d42d (patch)
treeebcb0780e55fd31ae7c6eb0c68aaaa78ea750f46
parentb81da0de163194dc03cb651b3af6ed52c2d91fbd (diff)
downloadchromium_src-eaa987d5ea129080597e7e537a5037eea213d42d.zip
chromium_src-eaa987d5ea129080597e7e537a5037eea213d42d.tar.gz
chromium_src-eaa987d5ea129080597e7e537a5037eea213d42d.tar.bz2
Rename HTMLConstructionSite::insertSelfClosingHTMLElement{,DestroyingToken}
Make it obvious that the method mutates the passed token. This has caused bugs in the past, and this name will avoid making similar mistakes. BUG=None Review URL: https://codereview.chromium.org/1401823002 Cr-Commit-Position: refs/heads/master@{#354949}
-rw-r--r--third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp2
-rw-r--r--third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.h2
-rw-r--r--third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp17
3 files changed, 10 insertions, 11 deletions
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
index ed322ff..d280778 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
@@ -624,7 +624,7 @@ void HTMLConstructionSite::insertHTMLElement(AtomicHTMLToken* token)
m_openElements.push(HTMLStackItem::create(element.release(), token));
}
-void HTMLConstructionSite::insertSelfClosingHTMLElement(AtomicHTMLToken* token)
+void HTMLConstructionSite::insertSelfClosingHTMLElementDestroyingToken(AtomicHTMLToken* token)
{
ASSERT(token->type() == HTMLToken::StartTag);
// Normally HTMLElementStack is responsible for calling finishParsingChildren,
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.h b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.h
index 8e2b3d1..6aeb152 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.h
+++ b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.h
@@ -147,7 +147,7 @@ public:
void insertCommentOnDocument(AtomicHTMLToken*);
void insertCommentOnHTMLHtmlElement(AtomicHTMLToken*);
void insertHTMLElement(AtomicHTMLToken*);
- void insertSelfClosingHTMLElement(AtomicHTMLToken*);
+ void insertSelfClosingHTMLElementDestroyingToken(AtomicHTMLToken*);
void insertFormattingElement(AtomicHTMLToken*);
void insertHTMLHeadElement(AtomicHTMLToken*);
void insertHTMLBodyElement(AtomicHTMLToken*);
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
index f8a5ef3..b88efa1 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp
@@ -788,7 +788,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken* token)
|| token->name() == keygenTag
|| token->name() == wbrTag) {
m_tree.reconstructTheActiveFormattingElements();
- m_tree.insertSelfClosingHTMLElement(token);
+ m_tree.insertSelfClosingHTMLElementDestroyingToken(token);
m_framesetOk = false;
return;
}
@@ -800,8 +800,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken* token)
bool disableFrameset = !typeAttribute || !equalIgnoringCase(typeAttribute->value(), "hidden");
m_tree.reconstructTheActiveFormattingElements();
- // TODO(kouhei): Make it obvious that insertSelfClosingHTMLElement may mutate the token.
- m_tree.insertSelfClosingHTMLElement(token);
+ m_tree.insertSelfClosingHTMLElementDestroyingToken(token);
if (disableFrameset)
m_framesetOk = false;
@@ -811,12 +810,12 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken* token)
|| token->name() == paramTag
|| token->name() == sourceTag
|| token->name() == trackTag) {
- m_tree.insertSelfClosingHTMLElement(token);
+ m_tree.insertSelfClosingHTMLElementDestroyingToken(token);
return;
}
if (token->name() == hrTag) {
processFakePEndTagIfPInButtonScope();
- m_tree.insertSelfClosingHTMLElement(token);
+ m_tree.insertSelfClosingHTMLElementDestroyingToken(token);
m_framesetOk = false;
return;
}
@@ -1047,7 +1046,7 @@ void HTMLTreeBuilder::processStartTagForInTable(AtomicHTMLToken* token)
Attribute* typeAttribute = token->getAttributeItem(typeAttr);
if (typeAttribute && equalIgnoringCase(typeAttribute->value(), "hidden")) {
parseError(token);
- m_tree.insertSelfClosingHTMLElement(token);
+ m_tree.insertSelfClosingHTMLElementDestroyingToken(token);
return;
}
// Fall through to "anything else" case.
@@ -1176,7 +1175,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token)
return;
}
if (token->name() == colTag) {
- m_tree.insertSelfClosingHTMLElement(token);
+ m_tree.insertSelfClosingHTMLElementDestroyingToken(token);
return;
}
if (token->name() == templateTag) {
@@ -1303,7 +1302,7 @@ void HTMLTreeBuilder::processStartTag(AtomicHTMLToken* token)
return;
}
if (token->name() == frameTag) {
- m_tree.insertSelfClosingHTMLElement(token);
+ m_tree.insertSelfClosingHTMLElementDestroyingToken(token);
return;
}
if (token->name() == noframesTag) {
@@ -2582,7 +2581,7 @@ bool HTMLTreeBuilder::processStartTagForInHead(AtomicHTMLToken* token)
|| token->name() == commandTag
|| token->name() == linkTag
|| token->name() == metaTag) {
- m_tree.insertSelfClosingHTMLElement(token);
+ m_tree.insertSelfClosingHTMLElementDestroyingToken(token);
// Note: The custom processing for the <meta> tag is done in HTMLMetaElement::process().
return true;
}