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

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

Issue 2054433002: Implement "create an element" when sync for Custom Element V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-ce
Patch Set: haraken review and rebase Created 4 years, 6 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 | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Document.idl » ('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 ab4b0767245b116e8ab8fa5ab4bae921665ad2af..bcd02abab122b64a87a992643bf714e4d260b0c7 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -640,8 +640,11 @@ Element* Document::createElement(const AtomicString& name, ExceptionState& excep
return nullptr;
}
- if (isXHTMLDocument() || isHTMLDocument())
+ if (isXHTMLDocument() || isHTMLDocument()) {
+ if (CustomElement::shouldCreateCustomElement(*this, name))
+ return CustomElement::createCustomElementSync(*this, name, exceptionState);
return HTMLElementFactory::createHTMLElement(convertLocalName(name), *this, 0, CreatedByCreateElement);
+ }
return Element::create(QualifiedName(nullAtom, name, nullAtom), this);
}
@@ -656,7 +659,7 @@ Element* Document::createElement(const AtomicString& localName, const AtomicStri
Element* element;
if (CustomElement::shouldCreateCustomElement(*this, localName)) {
- element = CustomElement::createCustomElement(*this, localName, CreatedByCreateElement);
+ element = CustomElement::createCustomElementSync(*this, localName, exceptionState);
} else if (V0CustomElement::isValidName(localName) && registrationContext()) {
element = registrationContext()->createCustomTagElement(*this, QualifiedName(nullAtom, convertLocalName(localName), xhtmlNamespaceURI));
} else {
@@ -692,6 +695,8 @@ Element* Document::createElementNS(const AtomicString& namespaceURI, const Atomi
if (qName == QualifiedName::null())
return nullptr;
+ if (CustomElement::shouldCreateCustomElement(*this, qName))
+ return CustomElement::createCustomElementSync(*this, qName, exceptionState);
return createElement(qName, CreatedByCreateElement);
}
@@ -703,7 +708,7 @@ Element* Document::createElementNS(const AtomicString& namespaceURI, const Atomi
Element* element;
if (CustomElement::shouldCreateCustomElement(*this, qName))
- element = CustomElement::createCustomElement(*this, qName, CreatedByCreateElement);
+ element = CustomElement::createCustomElementSync(*this, qName, exceptionState);
else if (V0CustomElement::isValidName(qName.localName()) && registrationContext())
element = registrationContext()->createCustomTagElement(*this, qName);
else
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698