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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp

Issue 2002063003: Change "bool createdByParser" of createElement() to enum (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cestate
Patch Set: Add ImportNode Created 4 years, 7 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
Index: third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
index e40177f6081aa854534c78ef80d5941220094e16..48def60177b066daa1ab382406affcc826fc7675 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp
@@ -738,10 +738,15 @@ void HTMLConstructionSite::takeAllChildren(HTMLStackItem* newParent, HTMLElement
queueTask(task);
}
+CreateElementFlags HTMLConstructionSite::getCreateElementFlags() const
+{
+ return m_isParsingFragment ? CreatedByFragmentParser : CreatedByParser;
+}
+
Element* HTMLConstructionSite::createElement(AtomicHTMLToken* token, const AtomicString& namespaceURI)
{
QualifiedName tagName(nullAtom, token->name(), namespaceURI);
- Element* element = ownerDocumentForCurrentNode().createElement(tagName, true);
+ Element* element = ownerDocumentForCurrentNode().createElement(tagName, getCreateElementFlags());
setAttributes(element, token, m_parserContentPolicy);
return element;
}
@@ -762,7 +767,7 @@ HTMLElement* HTMLConstructionSite::createHTMLElement(AtomicHTMLToken* token)
// FIXME: This can't use HTMLConstructionSite::createElement because we
// have to pass the current form element. We should rework form association
// to occur after construction to allow better code sharing here.
- HTMLElement* element = HTMLElementFactory::createHTMLElement(token->name(), document, form, true);
+ HTMLElement* element = HTMLElementFactory::createHTMLElement(token->name(), document, form, getCreateElementFlags());
setAttributes(element, token, m_parserContentPolicy);
return element;
}

Powered by Google App Engine
This is Rietveld 408576698