Make createAttributeNS's qualifiedName argument non-nullable

Before this change, document.createAttributeNS("foo", null) would throw
"Failed to execute 'createAttributeNS' on 'Document': The qualified name
provided is empty." because the null string was treated as empty.

After this change, document.createAttributeNS("foo", null) will create
an Attr object with localName "null", which matches Firefox and IE.

Usage of this API is extremely low, making the risk equally so:
https://www.chromestatus.com/metrics/feature/timeline/popularity/112

BUG=460722

Review URL: https://codereview.chromium.org/1164123003

git-svn-id: svn://svn.chromium.org/blink/trunk@196940 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt
index dc8df05..0d49c08 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt
@@ -5,10 +5,10 @@
 
 PASS createAttributeNS(undefined, undefined)
 PASS createAttributeNS(null, undefined)
-PASS createAttributeNS(undefined, null); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided is empty.
-PASS createAttributeNS(null, null); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided is empty.
+PASS createAttributeNS(undefined, null)
+PASS createAttributeNS(null, null)
 PASS createAttributeNS(null, ""); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided is empty.
-PASS createAttributeNS("", null); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided is empty.
+PASS createAttributeNS("", null)
 PASS createAttributeNS("", ""); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided is empty.
 PASS createAttributeNS(null, "<div>"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('<div>') contains the invalid name-start character '<'.
 PASS createAttributeNS(null, "0div"); threw InvalidCharacterError: Failed to execute 'createAttributeNS' on 'Document': The qualified name provided ('0div') contains the invalid name-start character '0'.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js
index 06cfde2..7f25d8a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js
@@ -38,10 +38,10 @@
 var allNSTests = [
    { args: [undefined, undefined] },
    { args: [null, undefined] },
-   { args: [undefined, null], code: 5 },
-   { args: [null, null], code: 5 },
+   { args: [undefined, null] },
+   { args: [null, null] },
    { args: [null, ""], code: 5 },
-   { args: ["", null], code: 5 },
+   { args: ["", null] },
    { args: ["", ""], code: 5 },
    { args: [null, "<div>"], code: 5 },
    { args: [null, "0div"], code: 5 },
diff --git a/third_party/WebKit/Source/core/dom/Document.idl b/third_party/WebKit/Source/core/dom/Document.idl
index 5ebbf11..a27bc8a 100644
--- a/third_party/WebKit/Source/core/dom/Document.idl
+++ b/third_party/WebKit/Source/core/dom/Document.idl
@@ -61,8 +61,7 @@
     [RaisesException, CustomElementCallbacks, TypeChecking=Interface] Node adoptNode(Node node);
 
     [NewObject, RaisesException, MeasureAs=DocumentCreateAttribute] Attr createAttribute(DOMString localName);
-    // FIXME: qualifiedName should not be nullable.
-    [NewObject, RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeNS(DOMString? namespaceURI, DOMString? qualifiedName);
+    [NewObject, RaisesException, MeasureAs=DocumentCreateAttributeNS] Attr createAttributeNS(DOMString? namespaceURI, DOMString qualifiedName);
 
     [NewObject, RaisesException] Event createEvent(DOMString eventType);