Chromium Code Reviews| 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()) |