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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2505573002: CustomElements: createCustomElementSync accepts a definition (Closed)
Patch Set: createCustomElementSync accepts a definition Created 4 years, 1 month 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/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index befc759a2ea9f8666df3a87a1cae6533485487f8..92f55d65b9abc21088948626d22fcd93e9fc2fb2 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -678,12 +678,14 @@ Element* Document::createElement(const AtomicString& name,
// 2. If the context object is an HTML document, let localName be
// converted to ASCII lowercase.
AtomicString localName = convertLocalName(name);
- if (CustomElement::shouldCreateCustomElement(localName))
- return CustomElement::createCustomElementSync(*this, localName);
+ if (CustomElement::shouldCreateCustomElement(localName)) {
+ return CustomElement::createCustomElementSync(
+ *this,
+ QualifiedName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI));
+ }
return HTMLElementFactory::createHTMLElement(localName, *this, 0,
CreatedByCreateElement);
}
-
return Element::create(QualifiedName(nullAtom, name, nullAtom), this);
}
@@ -755,8 +757,8 @@ Element* Document::createElement(const AtomicString& localName,
Element* element;
if (definition) {
- element =
- CustomElement::createCustomElementSync(*this, convertedLocalName, name);
+ element = CustomElement::createCustomElementSync(*this, convertedLocalName,
+ definition);
} else if (V0CustomElement::isValidName(localName) && registrationContext()) {
element = registrationContext()->createCustomTagElement(
*this, QualifiedName(nullAtom, convertedLocalName, xhtmlNamespaceURI));
@@ -862,7 +864,7 @@ Element* Document::createElementNS(const AtomicString& namespaceURI,
isV1 && RuntimeEnabledFeatures::customElementsBuiltinEnabled();
if (CustomElement::shouldCreateCustomElement(qName) || shouldCreateBuiltin) {
- element = CustomElement::createCustomElementSync(*this, qName, is);
+ element = CustomElement::createCustomElementSync(*this, qName, definition);
} else if (V0CustomElement::isValidName(qName.localName()) &&
registrationContext()) {
element = registrationContext()->createCustomTagElement(*this, qName);

Powered by Google App Engine
This is Rietveld 408576698