Title: [203550] trunk
Revision
203550
Author
[email protected]
Date
2016-07-21 20:29:16 -0700 (Thu, 21 Jul 2016)

Log Message

Parameter to Document.createEvent() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=160065

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

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

Source/WebCore:

Parameter to Document.createEvent() should be mandatory as per the
specification:
- https://dom.spec.whatwg.org/#document

We already throw anyway when the parameter is omitted because we use
"undefined" as event type, which is invalid. However, we throw the
wrong exception.

Firefox and Chrome agree with the specification here.

No new tests, rebaselined existing tests.

* dom/Document.idl:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203549 => 203550)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-22 03:00:07 UTC (rev 203549)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-22 03:29:16 UTC (rev 203550)
@@ -1,5 +1,17 @@
 2016-07-21  Chris Dumez  <[email protected]>
 
+        Parameter to Document.createEvent() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160065
+
+        Reviewed by Darin Adler.
+
+        Rebaseline several W3C tests now that more checks are passing.
+
+        * web-platform-tests/dom/interfaces-expected.txt:
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
+2016-07-21  Chris Dumez  <[email protected]>
+
         Make parameters to Element.getElementsBy*() operations mandatory
         https://bugs.webkit.org/show_bug.cgi?id=160060
 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-07-22 03:00:07 UTC (rev 203549)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-07-22 03:29:16 UTC (rev 203550)
@@ -268,7 +268,7 @@
 PASS Document interface: operation adoptNode(Node) 
 PASS Document interface: operation createAttribute(DOMString) 
 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 createEvent(DOMString) 
 PASS Document interface: operation createRange() 
 PASS Document interface: operation createNodeIterator(Node,unsigned long,NodeFilter) 
 PASS Document interface: operation createTreeWalker(Node,unsigned long,NodeFilter) 
@@ -320,9 +320,7 @@
 PASS Document interface: new Document() must inherit property "createAttributeNS" with the proper type (23) 
 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);
-        }" threw object "NotSupportedError (DOM Exception 9): The operation is not..." ("NotSupportedError") expected object "TypeError" ("TypeError")
+PASS Document interface: calling createEvent(DOMString) on new Document() with too few arguments must throw TypeError 
 PASS Document interface: new Document() must inherit property "createRange" with the proper type (25) 
 PASS Document interface: new Document() must inherit property "createNodeIterator" with the proper type (26) 
 PASS Document interface: calling createNodeIterator(Node,unsigned long,NodeFilter) on new Document() with too few arguments must throw TypeError 
@@ -468,9 +466,7 @@
 PASS Document interface: xmlDoc must inherit property "createAttributeNS" with the proper type (23) 
 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);
-        }" threw object "NotSupportedError (DOM Exception 9): The operation is not..." ("NotSupportedError") expected object "TypeError" ("TypeError")
+PASS Document interface: calling createEvent(DOMString) on xmlDoc with too few arguments must throw TypeError 
 PASS Document interface: xmlDoc must inherit property "createRange" with the proper type (25) 
 PASS Document interface: xmlDoc must inherit property "createNodeIterator" with the proper type (26) 
 PASS Document interface: calling createNodeIterator(Node,unsigned long,NodeFilter) on xmlDoc with too few arguments must throw TypeError 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-07-22 03:00:07 UTC (rev 203549)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-07-22 03:29:16 UTC (rev 203550)
@@ -160,9 +160,7 @@
 PASS Document interface: iframe.contentDocument must inherit property "createAttributeNS" with the proper type (23) 
 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);
-        }" threw object "NotSupportedError (DOM Exception 9): The operation is not..." ("NotSupportedError") expected object "TypeError" ("TypeError")
+PASS Document interface: calling createEvent(DOMString) on iframe.contentDocument with too few arguments must throw TypeError 
 PASS Document interface: iframe.contentDocument must inherit property "createRange" with the proper type (25) 
 PASS Document interface: iframe.contentDocument must inherit property "createNodeIterator" with the proper type (26) 
 PASS Document interface: calling createNodeIterator(Node,unsigned long,NodeFilter) on iframe.contentDocument with too few arguments must throw TypeError 
@@ -442,9 +440,7 @@
 PASS Document interface: new Document() must inherit property "createAttributeNS" with the proper type (23) 
 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);
-        }" threw object "NotSupportedError (DOM Exception 9): The operation is not..." ("NotSupportedError") expected object "TypeError" ("TypeError")
+PASS Document interface: calling createEvent(DOMString) on new Document() with too few arguments must throw TypeError 
 PASS Document interface: new Document() must inherit property "createRange" with the proper type (25) 
 PASS Document interface: new Document() must inherit property "createNodeIterator" with the proper type (26) 
 PASS Document interface: calling createNodeIterator(Node,unsigned long,NodeFilter) on new Document() with too few arguments must throw TypeError 
@@ -727,9 +723,7 @@
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createAttributeNS" with the proper type (23) 
 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);
-        }" threw object "NotSupportedError (DOM Exception 9): The operation is not..." ("NotSupportedError") expected object "TypeError" ("TypeError")
+PASS Document interface: calling createEvent(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 "createRange" with the proper type (25) 
 PASS Document interface: document.implementation.createDocument(null, "", null) must inherit property "createNodeIterator" with the proper type (26) 
 PASS Document interface: calling createNodeIterator(Node,unsigned long,NodeFilter) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError 

Modified: trunk/Source/WebCore/ChangeLog (203549 => 203550)


--- trunk/Source/WebCore/ChangeLog	2016-07-22 03:00:07 UTC (rev 203549)
+++ trunk/Source/WebCore/ChangeLog	2016-07-22 03:29:16 UTC (rev 203550)
@@ -1,3 +1,24 @@
+2016-07-21  Chris Dumez  <[email protected]>
+
+        Parameter to Document.createEvent() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160065
+
+        Reviewed by Darin Adler.
+
+        Parameter to Document.createEvent() should be mandatory as per the
+        specification:
+        - https://dom.spec.whatwg.org/#document
+
+        We already throw anyway when the parameter is omitted because we use
+        "undefined" as event type, which is invalid. However, we throw the
+        wrong exception.
+
+        Firefox and Chrome agree with the specification here.
+
+        No new tests, rebaselined existing tests.
+
+        * dom/Document.idl:
+
 2016-07-21  Brian Burg  <[email protected]>
 
         REGRESSION(r62549): Objective-C DOM bindings sometimes fail to regenerate when CodeGenerator.pm is modified

Modified: trunk/Source/WebCore/dom/Document.idl (203549 => 203550)


--- trunk/Source/WebCore/dom/Document.idl	2016-07-22 03:00:07 UTC (rev 203549)
+++ trunk/Source/WebCore/dom/Document.idl	2016-07-22 03:29:16 UTC (rev 203550)
@@ -86,8 +86,7 @@
 
     // DOM Level 2 Events (DocumentEvents interface)
 
-    // FIXME: Using "undefined" as default parameter value is wrong.
-    [RaisesException, NewObject] Event createEvent(optional DOMString eventType = "undefined");
+    [RaisesException, NewObject] Event createEvent(DOMString eventType);
 
     // DOM Level 2 Tranversal and Range (DocumentRange interface)
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to