Changeset 203848 in webkit


Ignore:
Timestamp:
Jul 28, 2016 4:15:07 PM (8 years ago)
Author:
Chris Dumez
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:

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:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r203845 r203848  
     12016-07-28  Chris Dumez  <cdumez@apple.com>
     2
     3        Parameters to Event.initEvent() should be mandatory
     4        https://bugs.webkit.org/show_bug.cgi?id=160320
     5
     6        Reviewed by Darin Adler.
     7
     8        Update existing tests to make sure they call initEvent() will all 3
     9        parameters.
     10
     11        * fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml:
     12        * fast/forms/form-submission-create-crash.xhtml:
     13        * js/arity-mismatch-at-vmentry.html:
     14
    1152016-07-28  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml

    r185745 r203848  
    2020document.addEventListener("beforeload", setText, true);
    2121event = document.createEvent("Event");
    22 event.initEvent("beforeload", false);
     22event.initEvent("beforeload", false, false);
    2323document.documentElement.dispatchEvent(event);
    2424</script>
  • trunk/LayoutTests/fast/forms/form-submission-create-crash.xhtml

    r121008 r203848  
    1515runTest = function() {
    1616    event = document.createEvent("MouseEvent");
    17     event.initEvent("click");
     17    event.initEvent("click", false, false);
    1818    textNode.dispatchEvent(event);
    1919    if (window.testRunner)
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r203846 r203848  
     12016-07-28  Chris Dumez  <cdumez@apple.com>
     2
     3        Parameters to Event.initEvent() should be mandatory
     4        https://bugs.webkit.org/show_bug.cgi?id=160320
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline W3C tests now that more checks are passing.
     9
     10        * web-platform-tests/dom/interfaces-expected.txt:
     11        * web-platform-tests/html/dom/interfaces-expected.txt:
     12
    1132016-07-28  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt

    r203745 r203848  
    2727PASS Event interface: attribute defaultPrevented
    2828PASS Event interface: attribute timeStamp
    29 FAIL Event interface: operation initEvent(DOMString,boolean,boolean) assert_equals: property has wrong .length expected 3 but got 0
     29PASS Event interface: operation initEvent(DOMString,boolean,boolean)
    3030PASS Event must be primary interface of document.createEvent("Event")
    3131PASS Stringification of document.createEvent("Event")
     
    4747PASS Event interface: document.createEvent("Event") must inherit property "timeStamp" with the proper type (15)
    4848PASS Event interface: document.createEvent("Event") must inherit property "initEvent" with the proper type (16)
    49 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 () {
    50             fn.apply(obj, args);
    51         }" did not throw
     49PASS Event interface: calling initEvent(DOMString,boolean,boolean) on document.createEvent("Event") with too few arguments must throw TypeError
    5250PASS Event must be primary interface of new Event("foo")
    5351PASS Stringification of new Event("foo")
     
    6967PASS Event interface: new Event("foo") must inherit property "timeStamp" with the proper type (15)
    7068PASS Event interface: new Event("foo") must inherit property "initEvent" with the proper type (16)
    71 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 () {
    72             fn.apply(obj, args);
    73         }" did not throw
     69PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new Event("foo") with too few arguments must throw TypeError
    7470PASS CustomEvent interface: existence and properties of interface object
    7571PASS CustomEvent interface object length
     
    10197PASS Event interface: new CustomEvent("foo") must inherit property "timeStamp" with the proper type (15)
    10298PASS Event interface: new CustomEvent("foo") must inherit property "initEvent" with the proper type (16)
    103 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 () {
    104             fn.apply(obj, args);
    105         }" did not throw
     99PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new CustomEvent("foo") with too few arguments must throw TypeError
    106100PASS EventTarget interface: existence and properties of interface object
    107101PASS EventTarget interface object length
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt

    r203846 r203848  
    23692369PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "timeStamp" with the proper type (15)
    23702370PASS Event interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "initEvent" with the proper type (16)
    2371 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 () {
    2372             fn.apply(obj, args);
    2373         }" did not throw
     2371PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new TrackEvent("addtrack", {track:document.createElement("track").track}) with too few arguments must throw TypeError
    23742372PASS HTMLMapElement interface: existence and properties of interface object
    23752373PASS HTMLMapElement interface object length
     
    55085506PASS Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "timeStamp" with the proper type (15)
    55095507PASS Event interface: new PopStateEvent("popstate", { data: {} }) must inherit property "initEvent" with the proper type (16)
    5510 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 () {
    5511             fn.apply(obj, args);
    5512         }" did not throw
     5508PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new PopStateEvent("popstate", { data: {} }) with too few arguments must throw TypeError
    55135509PASS HashChangeEvent interface: existence and properties of interface object
    55145510PASS HashChangeEvent interface object length
     
    58285824PASS Event interface: new CloseEvent("close") must inherit property "timeStamp" with the proper type (15)
    58295825PASS Event interface: new CloseEvent("close") must inherit property "initEvent" with the proper type (16)
    5830 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 () {
    5831             fn.apply(obj, args);
    5832         }" did not throw
     5826PASS Event interface: calling initEvent(DOMString,boolean,boolean) on new CloseEvent("close") with too few arguments must throw TypeError
    58335827PASS MessageChannel interface: existence and properties of interface object
    58345828PASS MessageChannel interface object length
  • trunk/LayoutTests/js/arity-mismatch-at-vmentry.html

    r173178 r203848  
    3030    var dispatch_fn = function() {
    3131        evt = document.createEvent("Event");
    32         evt.initEvent("readystatechange");
     32        evt.initEvent("readystatechange", false, false);
    3333        document.getElementById("span").dispatchEvent(evt);
    3434    }
  • trunk/Source/WebCore/ChangeLog

    r203847 r203848  
     12016-07-28  Chris Dumez  <cdumez@apple.com>
     2
     3        Parameters to Event.initEvent() should be mandatory
     4        https://bugs.webkit.org/show_bug.cgi?id=160320
     5
     6        Reviewed by Darin Adler.
     7
     8        Parameters to Event.initEvent() should be mandatory:
     9        - https://dom.spec.whatwg.org/#interface-event
     10
     11        Firefox agrees with the specification. Chrome does not.
     12
     13        No new tests, rebaselined existing tests.
     14
     15        * dom/Event.idl:
     16
    1172016-07-28  Anders Carlsson  <andersca@apple.com>
    218
  • trunk/Source/WebCore/dom/Event.idl

    r202953 r203848  
    6767    void               preventDefault();
    6868
    69     // FIXME: Using "undefined" as default parameter value is wrong.
    70     [ObjCLegacyUnnamedParameters] void initEvent(optional DOMString eventTypeArg = "undefined",
    71                                   optional boolean canBubbleArg = false,
    72                                   optional boolean cancelableArg = false);
     69    [ObjCLegacyUnnamedParameters] void initEvent(DOMString eventTypeArg, boolean canBubbleArg, boolean cancelableArg);
    7370
    7471    // DOM Level 3 Additions.
  • trunk/Source/WebInspectorUI/ChangeLog

    r203845 r203848  
     12016-07-28  Chris Dumez  <cdumez@apple.com>
     2
     3        Parameters to Event.initEvent() should be mandatory
     4        https://bugs.webkit.org/show_bug.cgi?id=160320
     5
     6        Reviewed by Darin Adler.
     7
     8        Update WebInspector accordingly.
     9
     10        * UserInterface/Models/NativeFunctionParameters.js:
     11
    1122016-07-28  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/Source/WebInspectorUI/UserInterface/Models/NativeFunctionParameters.js

    r203845 r203848  
    814814
    815815    Event: {
    816         initEvent: "[type], [canBubble], [cancelable]",
     816        initEvent: "type, canBubble, cancelable",
    817817        __proto__: null,
    818818    },
Note: See TracChangeset for help on using the changeset viewer.