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

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

Issue 442343002: Creating custom element should not be case sensitive (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing Comments Created 6 years, 4 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: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 6d2a060598458f4b7cd1267c85f963cb2b87bd16..c8b7254b6bc6243d77861842a0df72721ded44df 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -758,6 +758,11 @@ void Document::childrenChanged(const ChildrenChange& change)
m_documentElement = ElementTraversal::firstWithin(*this);
}
+AtomicString Document::localNameForHTMLDocument(const AtomicString& name)
+{
+ return Document::isHTMLDocument() ? name.lower() : name;
esprehn 2014/08/13 07:01:10 No need to add Document:: to call a method. This p
deepak.sa 2014/08/13 12:44:38 Done.
+}
+
PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& name, ExceptionState& exceptionState)
{
if (!isValidName(name)) {
@@ -766,7 +771,7 @@ PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& name
}
if (isXHTMLDocument() || isHTMLDocument())
- return HTMLElementFactory::createHTMLElement(isHTMLDocument() ? name.lower() : name, *this, 0, false);
+ return HTMLElementFactory::createHTMLElement(localNameForHTMLDocument(name), *this, 0, false);
return Element::create(QualifiedName(nullAtom, name, nullAtom), this);
}
@@ -781,7 +786,7 @@ PassRefPtrWillBeRawPtr<Element> Document::createElement(const AtomicString& loca
RefPtrWillBeRawPtr<Element> element;
if (CustomElement::isValidName(localName) && registrationContext()) {
- element = registrationContext()->createCustomTagElement(*this, QualifiedName(nullAtom, localName, xhtmlNamespaceURI));
+ element = registrationContext()->createCustomTagElement(*this, QualifiedName(nullAtom, localNameForHTMLDocument(localName), xhtmlNamespaceURI));
} else {
element = createElement(localName, exceptionState);
if (exceptionState.hadException())

Powered by Google App Engine
This is Rietveld 408576698