Title: [203848] trunk
Revision
203848
Author
[email protected]
Date
2016-07-28 16:15:07 -0700 (Thu, 28 Jul 2016)

Log Message

Parameters to Event.initEvent() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=160320

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline 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:

Parameters to Event.initEvent() should be mandatory:
- https://dom.spec.whatwg.org/#interface-event

Firefox agrees with the specification. Chrome does not.

No new tests, rebaselined existing tests.

* dom/Event.idl:

Source/WebInspectorUI:

Update WebInspector accordingly.

* UserInterface/Models/NativeFunctionParameters.js:

LayoutTests:

Update existing tests to make sure they call initEvent() will all 3
parameters.

* fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml:
* fast/forms/form-submission-create-crash.xhtml:
* js/arity-mismatch-at-vmentry.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203847 => 203848)


--- trunk/LayoutTests/ChangeLog	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/LayoutTests/ChangeLog	2016-07-28 23:15:07 UTC (rev 203848)
@@ -1,5 +1,19 @@
 2016-07-28  Chris Dumez  <[email protected]>
 
+        Parameters to Event.initEvent() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160320
+
+        Reviewed by Darin Adler.
+
+        Update existing tests to make sure they call initEvent() will all 3
+        parameters.
+
+        * fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml:
+        * fast/forms/form-submission-create-crash.xhtml:
+        * js/arity-mismatch-at-vmentry.html:
+
+2016-07-28  Chris Dumez  <[email protected]>
+
         First parameter to canvas.getContext() / probablySupportsContext() should be mandatory
         https://bugs.webkit.org/show_bug.cgi?id=160312
 

Modified: trunk/LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml (203847 => 203848)


--- trunk/LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml	2016-07-28 23:15:07 UTC (rev 203848)
@@ -19,7 +19,7 @@
 document.getElementById("object").textContent = "A";
 document.addEventListener("beforeload", setText, true);
 event = document.createEvent("Event");
-event.initEvent("beforeload", false);
+event.initEvent("beforeload", false, false);
 document.documentElement.dispatchEvent(event);
 </script>
 <script src=""

Modified: trunk/LayoutTests/fast/forms/form-submission-create-crash.xhtml (203847 => 203848)


--- trunk/LayoutTests/fast/forms/form-submission-create-crash.xhtml	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/LayoutTests/fast/forms/form-submission-create-crash.xhtml	2016-07-28 23:15:07 UTC (rev 203848)
@@ -14,7 +14,7 @@
 
 runTest = function() {
     event = document.createEvent("MouseEvent");
-    event.initEvent("click");
+    event.initEvent("click", false, false);
     textNode.dispatchEvent(event);
     if (window.testRunner)
         testRunner.notifyDone();

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (203847 => 203848)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-07-28 23:15:07 UTC (rev 203848)
@@ -1,5 +1,17 @@
 2016-07-28  Chris Dumez  <[email protected]>
 
+        Parameters to Event.initEvent() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160320
+
+        Reviewed by Darin Adler.
+
+        Rebaseline 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-28  Chris Dumez  <[email protected]>
+
         2 first parameters to window.postMessage() should be mandatory
         https://bugs.webkit.org/show_bug.cgi?id=160319
 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt	2016-07-28 23:15:07 UTC (rev 203848)
@@ -26,7 +26,7 @@
 PASS Event interface: operation preventDefault() 
 PASS Event interface: attribute defaultPrevented 
 PASS Event interface: attribute timeStamp 
-FAIL Event interface: operation initEvent(DOMString,boolean,boolean) assert_equals: property has wrong .length expected 3 but got 0
+PASS Event interface: operation initEvent(DOMString,boolean,boolean) 
 PASS Event must be primary interface of document.createEvent("Event") 
 PASS Stringification of document.createEvent("Event") 
 PASS Event interface: document.createEvent("Event") must inherit property "type" with the proper type (0) 
@@ -46,9 +46,7 @@
 PASS Event interface: document.createEvent("Event") must have own property "isTrusted" 
 PASS Event interface: document.createEvent("Event") must inherit property "timeStamp" with the proper type (15) 
 PASS Event interface: document.createEvent("Event") must inherit property "initEvent" with the proper type (16) 
-FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on document.createEvent("Event") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Event interface: calling initEvent(DOMString,boolean,boolean) on document.createEvent("Event") with too few arguments must throw TypeError 
 PASS Event must be primary interface of new Event("foo") 
 PASS Stringification of new Event("foo") 
 PASS Event interface: new Event("foo") must inherit property "type" with the proper type (0) 
@@ -68,9 +66,7 @@
 PASS Event interface: new Event("foo") must have own property "isTrusted" 
 PASS Event interface: new Event("foo") must inherit property "timeStamp" with the proper type (15) 
 PASS Event interface: new Event("foo") must inherit property "initEvent" with the proper type (16) 
-FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new Event("foo") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new Event("foo") with too few arguments must throw TypeError 
 PASS CustomEvent interface: existence and properties of interface object 
 PASS CustomEvent interface object length 
 PASS CustomEvent interface object name 
@@ -100,9 +96,7 @@
 PASS Event interface: new CustomEvent("foo") must have own property "isTrusted" 
 PASS Event interface: new CustomEvent("foo") must inherit property "timeStamp" with the proper type (15) 
 PASS Event interface: new CustomEvent("foo") must inherit property "initEvent" with the proper type (16) 
-FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent("foo") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent("foo") with too few arguments must throw TypeError 
 PASS EventTarget interface: existence and properties of interface object 
 PASS EventTarget interface object length 
 PASS EventTarget interface object name 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-07-28 23:15:07 UTC (rev 203848)
@@ -2368,9 +2368,7 @@
 PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must have own property "isTrusted" 
 PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "timeStamp" with the proper type (15) 
 PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "initEvent" with the proper type (16) 
-FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new TrackEvent("addtrack", {track:document.createElement("track").track}) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new TrackEvent("addtrack", {track:document.createElement("track").track}) with too few arguments must throw TypeError 
 PASS HTMLMapElement interface: existence and properties of interface object 
 PASS HTMLMapElement interface object length 
 PASS HTMLMapElement interface object name 
@@ -5507,9 +5505,7 @@
 PASS Event interface: new PopStateEvent("popstate", { data: {} }) must have own property "isTrusted" 
 PASS Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "timeStamp" with the proper type (15) 
 PASS Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "initEvent" with the proper type (16) 
-FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new PopStateEvent("popstate", { data: {} }) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new PopStateEvent("popstate", { data: {} }) with too few arguments must throw TypeError 
 PASS HashChangeEvent interface: existence and properties of interface object 
 PASS HashChangeEvent interface object length 
 PASS HashChangeEvent interface object name 
@@ -5827,9 +5823,7 @@
 PASS Event interface: new CloseEvent("close") must have own property "isTrusted" 
 PASS Event interface: new CloseEvent("close") must inherit property "timeStamp" with the proper type (15) 
 PASS Event interface: new CloseEvent("close") must inherit property "initEvent" with the proper type (16) 
-FAIL Event interface: calling initEvent(DOMString,boolean,boolean) on new CloseEvent("close") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
-            fn.apply(obj, args);
-        }" did not throw
+PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new CloseEvent("close") with too few arguments must throw TypeError 
 PASS MessageChannel interface: existence and properties of interface object 
 PASS MessageChannel interface object length 
 PASS MessageChannel interface object name 

Modified: trunk/LayoutTests/js/arity-mismatch-at-vmentry.html (203847 => 203848)


--- trunk/LayoutTests/js/arity-mismatch-at-vmentry.html	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/LayoutTests/js/arity-mismatch-at-vmentry.html	2016-07-28 23:15:07 UTC (rev 203848)
@@ -29,7 +29,7 @@
 
     var dispatch_fn = function() {
         evt = document.createEvent("Event");
-        evt.initEvent("readystatechange");
+        evt.initEvent("readystatechange", false, false);
         document.getElementById("span").dispatchEvent(evt);
     }
 

Modified: trunk/Source/WebCore/ChangeLog (203847 => 203848)


--- trunk/Source/WebCore/ChangeLog	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/Source/WebCore/ChangeLog	2016-07-28 23:15:07 UTC (rev 203848)
@@ -1,3 +1,19 @@
+2016-07-28  Chris Dumez  <[email protected]>
+
+        Parameters to Event.initEvent() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160320
+
+        Reviewed by Darin Adler.
+
+        Parameters to Event.initEvent() should be mandatory:
+        - https://dom.spec.whatwg.org/#interface-event
+
+        Firefox agrees with the specification. Chrome does not.
+
+        No new tests, rebaselined existing tests.
+
+        * dom/Event.idl:
+
 2016-07-28  Anders Carlsson  <[email protected]>
 
         Move a Mail.app workaround closer to where it's actually needed

Modified: trunk/Source/WebCore/dom/Event.idl (203847 => 203848)


--- trunk/Source/WebCore/dom/Event.idl	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/Source/WebCore/dom/Event.idl	2016-07-28 23:15:07 UTC (rev 203848)
@@ -66,10 +66,7 @@
     void               stopPropagation();
     void               preventDefault();
 
-    // FIXME: Using "undefined" as default parameter value is wrong.
-    [ObjCLegacyUnnamedParameters] void initEvent(optional DOMString eventTypeArg = "undefined",
-                                  optional boolean canBubbleArg = false,
-                                  optional boolean cancelableArg = false);
+    [ObjCLegacyUnnamedParameters] void initEvent(DOMString eventTypeArg, boolean canBubbleArg, boolean cancelableArg);
 
     // DOM Level 3 Additions.
     readonly attribute boolean defaultPrevented;

Modified: trunk/Source/WebInspectorUI/ChangeLog (203847 => 203848)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-07-28 23:15:07 UTC (rev 203848)
@@ -1,5 +1,16 @@
 2016-07-28  Chris Dumez  <[email protected]>
 
+        Parameters to Event.initEvent() should be mandatory
+        https://bugs.webkit.org/show_bug.cgi?id=160320
+
+        Reviewed by Darin Adler.
+
+        Update WebInspector accordingly.
+
+        * UserInterface/Models/NativeFunctionParameters.js:
+
+2016-07-28  Chris Dumez  <[email protected]>
+
         First parameter to canvas.getContext() / probablySupportsContext() should be mandatory
         https://bugs.webkit.org/show_bug.cgi?id=160312
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js (203847 => 203848)


--- trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js	2016-07-28 22:21:03 UTC (rev 203847)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js	2016-07-28 23:15:07 UTC (rev 203848)
@@ -813,7 +813,7 @@
     },
 
     Event: {
-        initEvent: "[type], [canBubble], [cancelable]",
+        initEvent: "type, canBubble, cancelable",
         __proto__: null,
     },
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to