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