Title: [203441] trunk
Revision
203441
Author
[email protected]
Date
2016-07-19 18:45:51 -0700 (Tue, 19 Jul 2016)

Log Message

Document.createElementNS() / createAttributeNS() parameters should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=159938

Reviewed by Benjamin Poulain.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Document.createElementNS() / createAttributeNS() parameters should be mandatory:
- https://dom.spec.whatwg.org/#document

They were optional in WebKit. However, Firefox and Chrome both match the
specification.

No new tests, rebaselined existing tests.

* dom/Document.idl:

LayoutTests:

Update / rebaseline existing tests to reflect the behavior change.

* fast/dom/Document/createAttributeNS-namespace-err-expected.txt:
* fast/dom/Document/createElementNS-namespace-err-expected.txt:
* fast/dom/Document/script-tests/createAttributeNS-namespace-err.js:
* fast/dom/Document/script-tests/createElementNS-namespace-err.js:
* fast/dom/attribute-downcast-right.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203440 => 203441)


--- trunk/LayoutTests/ChangeLog	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/ChangeLog	2016-07-20 01:45:51 UTC (rev 203441)
@@ -1,3 +1,18 @@
+2016-07-19  Chris Dumez  <[email protected]>
+
+        Document.createElementNS() / createAttributeNS() parameters should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=159938
+
+        Reviewed by Benjamin Poulain.
+
+        Update / rebaseline existing tests to reflect the behavior change.
+
+        * fast/dom/Document/createAttributeNS-namespace-err-expected.txt:
+        * fast/dom/Document/createElementNS-namespace-err-expected.txt:
+        * fast/dom/Document/script-tests/createAttributeNS-namespace-err.js:
+        * fast/dom/Document/script-tests/createElementNS-namespace-err.js:
+        * fast/dom/attribute-downcast-right.html:
+
 2016-07-19  Benjamin Poulain  <[email protected]>
 
         Use getElementById for attribute matching if the attribute name is html's id

Modified: trunk/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt (203440 => 203441)


--- trunk/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt	2016-07-20 01:45:51 UTC (rev 203441)
@@ -3,14 +3,14 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS document.createAttributeNS().toString() is "[object Attr]"
-PASS document.createAttributeNS("http://www.example.com").toString() is "[object Attr]"
+PASS document.createAttributeNS() threw exception TypeError: Not enough arguments.
+PASS document.createAttributeNS("http://www.example.com") threw exception TypeError: Not enough arguments.
 PASS createAttributeNS(undefined, undefined)
 PASS createAttributeNS(null, undefined)
-PASS createAttributeNS(undefined, null); threw INVALID_CHARACTER_ERR
-PASS createAttributeNS(null, null); threw INVALID_CHARACTER_ERR
+PASS createAttributeNS(undefined, null)
+PASS createAttributeNS(null, null)
 PASS createAttributeNS(null, ""); threw INVALID_CHARACTER_ERR
-PASS createAttributeNS("", null); threw INVALID_CHARACTER_ERR
+PASS createAttributeNS("", null)
 PASS createAttributeNS("", ""); threw INVALID_CHARACTER_ERR
 PASS createAttributeNS(null, "<div>"); threw INVALID_CHARACTER_ERR
 PASS createAttributeNS(null, "0div"); threw INVALID_CHARACTER_ERR

Modified: trunk/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt (203440 => 203441)


--- trunk/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt	2016-07-20 01:45:51 UTC (rev 203441)
@@ -3,15 +3,15 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS document.createElementNS().toString() is "[object Element]"
-PASS document.createElementNS("http://www.example.com").toString() is "[object Element]"
+PASS document.createElementNS() threw exception TypeError: Not enough arguments.
+PASS document.createElementNS("http://www.example.com") threw exception TypeError: Not enough arguments.
 HTML tests:
 PASS createElementNS(, )
 PASS createElementNS(null, )
-PASS createElementNS(, null); threw INVALID_CHARACTER_ERR
-PASS createElementNS(null, null); threw INVALID_CHARACTER_ERR
+PASS createElementNS(, null)
+PASS createElementNS(null, null)
 PASS createElementNS(null, ""); threw INVALID_CHARACTER_ERR
-PASS createElementNS("", null); threw INVALID_CHARACTER_ERR
+PASS createElementNS("", null)
 PASS createElementNS("", ""); threw INVALID_CHARACTER_ERR
 PASS createElementNS(null, "<div>"); threw INVALID_CHARACTER_ERR
 PASS createElementNS(null, "0div"); threw INVALID_CHARACTER_ERR

Modified: trunk/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js (203440 => 203441)


--- trunk/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/fast/dom/Document/script-tests/createAttributeNS-namespace-err.js	2016-07-20 01:45:51 UTC (rev 203441)
@@ -37,10 +37,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 },
@@ -123,8 +123,7 @@
     }
 }
 
-// Moz throws a "Not enough arguments" exception in these, we don't:
-shouldBeEqualToString("document.createAttributeNS().toString()", "[object Attr]");
-shouldBeEqualToString("document.createAttributeNS(\"http://www.example.com\").toString()", "[object Attr]");
+shouldThrow("document.createAttributeNS()", "'TypeError: Not enough arguments'");
+shouldThrow("document.createAttributeNS(\"http://www.example.com\")", "'TypeError: Not enough arguments'");
 
 runNSTests();

Modified: trunk/LayoutTests/fast/dom/Document/script-tests/createElementNS-namespace-err.js (203440 => 203441)


--- trunk/LayoutTests/fast/dom/Document/script-tests/createElementNS-namespace-err.js	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/fast/dom/Document/script-tests/createElementNS-namespace-err.js	2016-07-20 01:45:51 UTC (rev 203441)
@@ -37,10 +37,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 },
@@ -157,9 +157,8 @@
     }
 }
 
-// Moz throws a "Not enough arguments" exception in these, we don't:
-shouldBeEqualToString("document.createElementNS().toString()", "[object Element]");
-shouldBeEqualToString("document.createElementNS(\"http://www.example.com\").toString()", "[object Element]");
+shouldThrow("document.createElementNS()", "'TypeError: Not enough arguments'");
+shouldThrow("document.createElementNS(\"http://www.example.com\")", "'TypeError: Not enough arguments'");
 
 debug("HTML tests:")
 runNSTests(allNSTests, document, "createElementNS");

Modified: trunk/LayoutTests/fast/dom/attribute-downcast-right.html (203440 => 203441)


--- trunk/LayoutTests/fast/dom/attribute-downcast-right.html	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/fast/dom/attribute-downcast-right.html	2016-07-20 01:45:51 UTC (rev 203441)
@@ -3,7 +3,7 @@
     testRunner.dumpAsText();
 
 var oElement = document.createElement("s")
-var oElementNS = document.createElementNS();
+var oElementNS = document.createElementNS(null, "test");
 oElementNS.setAttributeNS();
 var oAttributeNS = oElementNS.getAttributeNodeNS();
 var oAttributeNSClone = oAttributeNS.cloneNode();

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203440 => 203441)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-20 01:45:51 UTC (rev 203441)
@@ -1,5 +1,18 @@
 2016-07-19  Chris Dumez  <[email protected]>
 
+        Document.createElementNS() / createAttributeNS() parameters should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=159938
+
+        Reviewed by Benjamin Poulain.
+
+        Rebaseline several W3C tests now that more checks are passing.
+
+        * web-platform-tests/dom/interfaces-expected.txt:
+        * web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
+2016-07-19  Chris Dumez  <[email protected]>
+
         Fix null handling of HTMLScriptElement.text attribute
         https://bugs.webkit.org/show_bug.cgi?id=159943
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt (203440 => 203441)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-07-20 01:45:51 UTC (rev 203441)
@@ -259,7 +259,7 @@
 FAIL Document interface: operation getElementsByTagNameNS(DOMString,DOMString) assert_equals: property has wrong .length expected 2 but got 0
 FAIL Document interface: operation getElementsByClassName(DOMString) assert_equals: property has wrong .length expected 1 but got 0
 PASS Document interface: operation createElement(DOMString,ElementCreationOptions) 
-FAIL Document interface: operation createElementNS(DOMString,DOMString,ElementCreationOptions) assert_equals: property has wrong .length expected 2 but got 0
+PASS Document interface: operation createElementNS(DOMString,DOMString,ElementCreationOptions) 
 PASS Document interface: operation createDocumentFragment() 
 FAIL Document interface: operation createTextNode(DOMString) assert_equals: property has wrong .length expected 1 but got 0
 FAIL Document interface: operation createComment(DOMString) assert_equals: property has wrong .length expected 1 but got 0
@@ -267,7 +267,7 @@
 PASS Document interface: operation importNode(Node,boolean) 
 PASS Document interface: operation adoptNode(Node) 
 FAIL Document interface: operation createAttribute(DOMString) assert_equals: property has wrong .length expected 1 but got 0
-FAIL Document interface: operation createAttributeNS(DOMString,DOMString) assert_equals: property has wrong .length expected 2 but got 0
+PASS Document interface: operation createAttributeNS(DOMString,DOMString) 
 FAIL Document interface: operation createEvent(DOMString) assert_equals: property has wrong .length expected 1 but got 0
 PASS Document interface: operation createRange() 
 PASS Document interface: operation createNodeIterator(Node,unsigned long,NodeFilter) 
@@ -309,9 +309,7 @@
 PASS Document interface: new Document() must inherit property "createElement" with the proper type (14) 
 PASS Document interface: calling createElement(DOMString,ElementCreationOptions) on new Document() with too few arguments must throw TypeError 
 PASS Document interface: new Document() must inherit property "createElementNS" with the proper type (15) 
-FAIL Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on new Document() with too few arguments must throw TypeError 
 PASS Document interface: new Document() must inherit property "createDocumentFragment" with the proper type (16) 
 PASS Document interface: new Document() must inherit property "createTextNode" with the proper type (17) 
 FAIL Document interface: calling createTextNode(DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
@@ -334,9 +332,7 @@
             fn.apply(obj, args);
         }" did not throw
 PASS Document interface: new Document() must inherit property "createAttributeNS" with the proper type (23) 
-FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createAttributeNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError 
 PASS Document interface: new Document() must inherit property "createEvent" with the proper type (24) 
 FAIL Document interface: calling createEvent(DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
             fn.apply(obj, args);
@@ -475,9 +471,7 @@
 PASS Document interface: xmlDoc must inherit property "createElement" with the proper type (14) 
 PASS Document interface: calling createElement(DOMString,ElementCreationOptions) on xmlDoc with too few arguments must throw TypeError 
 PASS Document interface: xmlDoc must inherit property "createElementNS" with the proper type (15) 
-FAIL Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createElementNS(DOMString,DOMString,ElementCreationOptions) on xmlDoc with too few arguments must throw TypeError 
 PASS Document interface: xmlDoc must inherit property "createDocumentFragment" with the proper type (16) 
 PASS Document interface: xmlDoc must inherit property "createTextNode" with the proper type (17) 
 FAIL Document interface: calling createTextNode(DOMString) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
@@ -500,9 +494,7 @@
             fn.apply(obj, args);
         }" did not throw
 PASS Document interface: xmlDoc must inherit property "createAttributeNS" with the proper type (23) 
-FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createAttributeNS(DOMString,DOMString) on xmlDoc with too few arguments must throw TypeError 
 PASS Document interface: xmlDoc must inherit property "createEvent" with the proper type (24) 
 FAIL Document interface: calling createEvent(DOMString) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
             fn.apply(obj, args);

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt (203440 => 203441)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-createElementNS-expected.txt	2016-07-20 01:45:51 UTC (rev 203441)
@@ -156,20 +156,20 @@
 PASS createElementNS test 153: "foo:","xmlns:foo","NAMESPACE_ERR" 
 PASS createElementNS test 154: "foo:","xmlfoo:bar",null 
 PASS createElementNS test 155: "","","INVALID_CHARACTER_ERR" 
-FAIL createElementNS test 156: null,null,null The string contains invalid characters.
+PASS createElementNS test 156: null,null,null 
 PASS createElementNS test 157: null,"","INVALID_CHARACTER_ERR" 
-FAIL createElementNS test 158: undefined,null,null The string contains invalid characters.
+PASS createElementNS test 158: undefined,null,null 
 PASS createElementNS test 159: undefined,undefined,null 
 PASS createElementNS test 160: undefined,"","INVALID_CHARACTER_ERR" 
-FAIL createElementNS test 161: "http://example.com/",null,null The string contains invalid characters.
+PASS createElementNS test 161: "http://example.com/",null,null 
 PASS createElementNS test 162: "http://example.com/","","INVALID_CHARACTER_ERR" 
-FAIL createElementNS test 163: "/",null,null The string contains invalid characters.
+PASS createElementNS test 163: "/",null,null 
 PASS createElementNS test 164: "/","","INVALID_CHARACTER_ERR" 
-FAIL createElementNS test 165: "http://www.w3.org/XML/1998/namespace",null,null The string contains invalid characters.
+PASS createElementNS test 165: "http://www.w3.org/XML/1998/namespace",null,null 
 PASS createElementNS test 166: "http://www.w3.org/XML/1998/namespace","","INVALID_CHARACTER_ERR" 
-FAIL createElementNS test 167: "http://www.w3.org/2000/xmlns/",null,"NAMESPACE_ERR" assert_throws: function "function () { document.createElementNS(namespace, qualifi..." threw object "InvalidCharacterError (DOM Exception 5): The string conta..." that is not a DOMException NAMESPACE_ERR: property "code" is equal to 5, expected 14
+PASS createElementNS test 167: "http://www.w3.org/2000/xmlns/",null,"NAMESPACE_ERR" 
 PASS createElementNS test 168: "http://www.w3.org/2000/xmlns/","","INVALID_CHARACTER_ERR" 
-FAIL createElementNS test 169: "foo:",null,null The string contains invalid characters.
+PASS createElementNS test 169: "foo:",null,null 
 PASS createElementNS test 170: "foo:","","INVALID_CHARACTER_ERR" 
 PASS Lower-case HTML element without a prefix 
 PASS Lower-case HTML element with a prefix 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (203440 => 203441)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-07-20 01:45:51 UTC (rev 203441)
@@ -149,9 +149,7 @@
 PASS Document interface: iframe.contentDocument must inherit property "createElement" with the proper type (14) 
 PASS Document interface: calling createElement(DOMString) on iframe.contentDocument with too few arguments must throw TypeError 
 PASS Document interface: iframe.contentDocument must inherit property "createElementNS" with the proper type (15) 
-FAIL Document interface: calling createElementNS(DOMString,DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createElementNS(DOMString,DOMString) on iframe.contentDocument with too few arguments must throw TypeError 
 PASS Document interface: iframe.contentDocument must inherit property "createDocumentFragment" with the proper type (16) 
 PASS Document interface: iframe.contentDocument must inherit property "createTextNode" with the proper type (17) 
 FAIL Document interface: calling createTextNode(DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
@@ -174,9 +172,7 @@
             fn.apply(obj, args);
         }" did not throw
 PASS Document interface: iframe.contentDocument must inherit property "createAttributeNS" with the proper type (23) 
-FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createAttributeNS(DOMString,DOMString) on iframe.contentDocument with too few arguments must throw TypeError 
 PASS Document interface: iframe.contentDocument must inherit property "createEvent" with the proper type (24) 
 FAIL Document interface: calling createEvent(DOMString) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
             fn.apply(obj, args);
@@ -451,9 +447,7 @@
 PASS Document interface: new Document() must inherit property "createElement" with the proper type (14) 
 PASS Document interface: calling createElement(DOMString) on new Document() with too few arguments must throw TypeError 
 PASS Document interface: new Document() must inherit property "createElementNS" with the proper type (15) 
-FAIL Document interface: calling createElementNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createElementNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError 
 PASS Document interface: new Document() must inherit property "createDocumentFragment" with the proper type (16) 
 PASS Document interface: new Document() must inherit property "createTextNode" with the proper type (17) 
 FAIL Document interface: calling createTextNode(DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
@@ -476,9 +470,7 @@
             fn.apply(obj, args);
         }" did not throw
 PASS Document interface: new Document() must inherit property "createAttributeNS" with the proper type (23) 
-FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createAttributeNS(DOMString,DOMString) on new Document() with too few arguments must throw TypeError 
 PASS Document interface: new Document() must inherit property "createEvent" with the proper type (24) 
 FAIL Document interface: calling createEvent(DOMString) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
             fn.apply(obj, args);
@@ -756,9 +748,7 @@
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createElement" with the proper type (14) 
 PASS Document interface: calling createElement(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createElementNS" with the proper type (15) 
-FAIL Document interface: calling createElementNS(DOMString,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createElementNS(DOMString,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createDocumentFragment" with the proper type (16) 
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createTextNode" with the proper type (17) 
 FAIL Document interface: calling createTextNode(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
@@ -781,9 +771,7 @@
             fn.apply(obj, args);
         }" did not throw
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createAttributeNS" with the proper type (23) 
-FAIL Document interface: calling createAttributeNS(DOMString,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Document interface: calling createAttributeNS(DOMString,DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createEvent" with the proper type (24) 
 FAIL Document interface: calling createEvent(DOMString) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
             fn.apply(obj, args);

Modified: trunk/LayoutTests/svg/dom/element-removed-while-inserting-parent-crash.html (203440 => 203441)


--- trunk/LayoutTests/svg/dom/element-removed-while-inserting-parent-crash.html	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/LayoutTests/svg/dom/element-removed-while-inserting-parent-crash.html	2016-07-20 01:45:51 UTC (rev 203441)
@@ -5,7 +5,7 @@
 if (window.testRunner)
     testRunner.dumpAsText();
 
-var element = document.createElementNS('http://www.w3.org/2000/svg');
+var element = document.createElementNS('http://www.w3.org/2000/svg', "test");
 
 var script = document.createElementNS('http://www.w3.org/2000/svg', 'script');
 script.id = 'script';

Modified: trunk/Source/WebCore/ChangeLog (203440 => 203441)


--- trunk/Source/WebCore/ChangeLog	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/Source/WebCore/ChangeLog	2016-07-20 01:45:51 UTC (rev 203441)
@@ -1,3 +1,20 @@
+2016-07-19  Chris Dumez  <[email protected]>
+
+        Document.createElementNS() / createAttributeNS() parameters should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=159938
+
+        Reviewed by Benjamin Poulain.
+
+        Document.createElementNS() / createAttributeNS() parameters should be mandatory:
+        - https://dom.spec.whatwg.org/#document
+
+        They were optional in WebKit. However, Firefox and Chrome both match the
+        specification.
+
+        No new tests, rebaselined existing tests.
+
+        * dom/Document.idl:
+
 2016-07-19  Benjamin Poulain  <[email protected]>
 
         Use getElementById for attribute matching if the attribute name is html's id

Modified: trunk/Source/WebCore/dom/Document.idl (203440 => 203441)


--- trunk/Source/WebCore/dom/Document.idl	2016-07-20 01:45:25 UTC (rev 203440)
+++ trunk/Source/WebCore/dom/Document.idl	2016-07-20 01:45:51 UTC (rev 203441)
@@ -58,16 +58,9 @@
 
     [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Node importNode(Node importedNode, optional boolean deep = false);
 
-    // FIXME: 'qualifiedName' should not have [TreatNullAs=EmptyString].
-    // FIXME: Using "undefined" as default parameter value is wrong.
-    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS(optional DOMString? namespaceURI = null,
-        [TreatNullAs=EmptyString] optional DOMString qualifiedName = "undefined");
+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);
+    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS(DOMString? namespaceURI, DOMString qualifiedName);
 
-    // FIXME: 'qualifiedName' should not have [TreatNullAs=EmptyString].
-    // FIXME: Using "undefined" as default parameter value is wrong.
-    [ObjCLegacyUnnamedParameters, NewObject, RaisesException] Attr createAttributeNS(optional DOMString? namespaceURI = null,
-        [TreatNullAs=EmptyString] optional DOMString qualifiedName = "undefined");
-
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
     [ObjCLegacyUnnamedParameters, ImplementedAs=getElementsByTagNameNSForObjC] NodeList getElementsByTagNameNS(optional DOMString namespaceURI, optional DOMString localName);
 #else
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to