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

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

Issue 122083002: createElementNS handles element name 'xmlns' correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 | « LayoutTests/fast/dom/setAttributeNS-prefix-and-null-namespace-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 934018a058c9f33e5f07dd6707fcf86f5716996a..b477c910fe58f4374a6a96caf7553d3f4f077957 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -969,8 +969,10 @@ bool Document::hasValidNamespaceForElements(const QualifiedName& qName)
// Required by DOM Level 3 Core and unspecified by DOM Level 2 Core:
// http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS
- // createElementNS("http://www.w3.org/2000/xmlns/", "foo:bar"), createElementNS(null, "xmlns:bar")
- if ((qName.prefix() == xmlnsAtom && qName.namespaceURI() != XMLNSNames::xmlnsNamespaceURI) || (qName.prefix() != xmlnsAtom && qName.namespaceURI() == XMLNSNames::xmlnsNamespaceURI))
+ // createElementNS("http://www.w3.org/2000/xmlns/", "foo:bar"), createElementNS(null, "xmlns:bar"), createElementNS(null, "xmlns")
+ if (qName.prefix() == xmlnsAtom || (qName.prefix().isEmpty() && qName.localName() == xmlnsAtom))
+ return qName.namespaceURI() == XMLNSNames::xmlnsNamespaceURI;
+ if (qName.namespaceURI() == XMLNSNames::xmlnsNamespaceURI)
return false;
return true;
abarth-chromium 2014/01/04 17:53:34 Can you change these last three lines to read: re
pwnall-personal 2014/01/04 19:31:37 Done.
@@ -978,12 +980,6 @@ bool Document::hasValidNamespaceForElements(const QualifiedName& qName)
bool Document::hasValidNamespaceForAttributes(const QualifiedName& qName)
{
- // Spec: DOM Level 2 Core: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElSetAttrNS
- if (qName.prefix().isEmpty() && qName.localName() == xmlnsAtom) {
- // Note: The case of an "xmlns" qualified name with a namespace of
- // xmlnsNamespaceURI is specifically allowed (See <http://www.w3.org/2000/xmlns/>).
- return qName.namespaceURI() == XMLNSNames::xmlnsNamespaceURI;
- }
return hasValidNamespaceForElements(qName);
}
« no previous file with comments | « LayoutTests/fast/dom/setAttributeNS-prefix-and-null-namespace-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698