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

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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/custom/CustomElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c76718880d71e336c379c790819c4e23af3f8206..df1040e9ccac010153bedd28973b2460b5b43f31 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -677,12 +677,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);
}
@@ -760,8 +762,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));
@@ -868,7 +870,7 @@ Element* Document::createElementNS(const AtomicString& namespaceURI,
Element* element;
if (CustomElement::shouldCreateCustomElement(qName) || createV1Builtin) {
- element = CustomElement::createCustomElementSync(*this, qName, is);
+ element = CustomElement::createCustomElementSync(*this, qName, definition);
} else if (V0CustomElement::isValidName(qName.localName()) &&
registrationContext()) {
element = registrationContext()->createCustomTagElement(*this, qName);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/custom/CustomElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698