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

Unified Diff: Source/core/dom/CustomElementRegistrationContext.cpp

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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/dom/CustomElementRegistrationContext.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/CustomElementRegistrationContext.cpp
diff --git a/Source/core/dom/CustomElementRegistrationContext.cpp b/Source/core/dom/CustomElementRegistrationContext.cpp
index 4cc4e68a86426c33c22e1e47b35d9762fca8f80a..6c4133f970275e819a8bed3d10334ea6e8a9b850 100644
--- a/Source/core/dom/CustomElementRegistrationContext.cpp
+++ b/Source/core/dom/CustomElementRegistrationContext.cpp
@@ -58,13 +58,10 @@ void CustomElementRegistrationContext::registerElement(Document* document, Custo
didResolveElement(definition, *it);
}
-PassRefPtr<Element> CustomElementRegistrationContext::createCustomTagElement(Document* document, const QualifiedName& tagName, CreationMode mode)
+PassRefPtr<Element> CustomElementRegistrationContext::createCustomTagElement(Document& document, const QualifiedName& tagName, CreationMode mode)
{
ASSERT(CustomElement::isValidName(tagName.localName()));
- if (!document)
- return 0;
-
RefPtr<Element> element;
if (HTMLNames::xhtmlNamespaceURI == tagName.namespaceURI()) {
@@ -73,7 +70,7 @@ PassRefPtr<Element> CustomElementRegistrationContext::createCustomTagElement(Doc
element = SVGUnknownElement::create(tagName, document);
} else {
// XML elements are not custom elements, so return early.
- return Element::create(tagName, document);
+ return Element::create(tagName, &document);
}
element->setCustomElementState(mode == CreatedByParser ? Element::WaitingForParser : Element::WaitingForUpgrade);
« no previous file with comments | « Source/core/dom/CustomElementRegistrationContext.h ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698