Changeset 203377 in webkit


Ignore:
Timestamp:
Jul 18, 2016, 3:33:32 PM (9 years ago)
Author:
Chris Dumez
Message:

The 2 first parameters to addEventListener() / removeEventListener() should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=158008

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

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

Source/WebCore:

The 2 first parameters to addEventListener() / removeEventListener() should be
mandatory:

Firefox 46 and Chrome 50 both match the specification and throw an exception when those
parameters are omitted. However, those parameters were marked as optional in WebKit and
the calls were no-ops if those parameters were omitted. This patch aligns our behavior
with the specification and other browsers.

Test: fast/dom/eventtarget-api-parameters.html

  • bindings/scripts/CodeGeneratorJS.pm:

(GetFunctionLength): Deleted.

  • dom/EventTarget.idl:

LayoutTests:

  • fast/dom/Window/window-legacy-event-listener-expected.txt: Removed.
  • fast/dom/Window/window-legacy-event-listener.html: Removed.
  • fast/dom/XMLHttpRequest-legacy-event-listener-expected.txt: Removed.
  • fast/dom/XMLHttpRequest-legacy-event-listener.html: Removed.
  • fast/dom/node-legacy-event-listener-expected.txt: Removed.
  • fast/dom/node-legacy-event-listener.html: Removed.

Drop legacy tests that expect the addEventListener() / removeEventListener()
parameters to be optional.

  • fast/dom/eventtarget-api-parameters-expected.txt: Added.
  • fast/dom/eventtarget-api-parameters.html: Added.

Add layout test to check that the 2 first parameters of addEventListener()
and removeEventListener() are now mandatory. It also checks that the
second parameter is nullable.

  • media/video-remote-control-playpause.html:

Drop useless call to addEventListener() without a listener as it now throws.

Location:
trunk
Files:
2 added
6 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r203374 r203377  
     12016-07-18  Chris Dumez  <cdumez@apple.com>
     2
     3        The 2 first parameters to addEventListener() / removeEventListener() should be mandatory
     4        https://bugs.webkit.org/show_bug.cgi?id=158008
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/dom/Window/window-legacy-event-listener-expected.txt: Removed.
     9        * fast/dom/Window/window-legacy-event-listener.html: Removed.
     10        * fast/dom/XMLHttpRequest-legacy-event-listener-expected.txt: Removed.
     11        * fast/dom/XMLHttpRequest-legacy-event-listener.html: Removed.
     12        * fast/dom/node-legacy-event-listener-expected.txt: Removed.
     13        * fast/dom/node-legacy-event-listener.html: Removed.
     14        Drop legacy tests that expect the addEventListener() / removeEventListener()
     15        parameters to be optional.
     16
     17        * fast/dom/eventtarget-api-parameters-expected.txt: Added.
     18        * fast/dom/eventtarget-api-parameters.html: Added.
     19        Add layout test to check that the 2 first parameters of addEventListener()
     20        and removeEventListener() are now mandatory. It also checks that the
     21        second parameter is nullable.
     22
     23        * media/video-remote-control-playpause.html:
     24        Drop useless call to addEventListener() without a listener as it now throws.
     25
    1262016-07-18  Brent Fulgham  <bfulgham@apple.com>
    227
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r203347 r203377  
     12016-07-18  Chris Dumez  <cdumez@apple.com>
     2
     3        The 2 first parameters to addEventListener() / removeEventListener() should be mandatory
     4        https://bugs.webkit.org/show_bug.cgi?id=158008
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline several W3C tests now that more checks are passing.
     9
     10        * web-platform-tests/XMLHttpRequest/interfaces-expected.txt:
     11        * web-platform-tests/dom/interfaces-expected.txt:
     12        * web-platform-tests/html/dom/interfaces-expected.txt:
     13
    1142016-07-18  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/interfaces-expected.txt

    r200309 r203377  
    3030PASS XMLHttpRequestEventTarget interface: (new XMLHttpRequest()).upload must inherit property "onloadend" with the proper type (6)
    3131PASS EventTarget interface: (new XMLHttpRequest()).upload must inherit property "addEventListener" with the proper type (0)
    32 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on (new XMLHttpRequest()).upload with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    33             fn.apply(obj, args);
    34         }" did not throw
     32PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on (new XMLHttpRequest()).upload with too few arguments must throw TypeError
    3533PASS EventTarget interface: (new XMLHttpRequest()).upload must inherit property "removeEventListener" with the proper type (1)
    36 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on (new XMLHttpRequest()).upload with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    37             fn.apply(obj, args);
    38         }" did not throw
     34PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on (new XMLHttpRequest()).upload with too few arguments must throw TypeError
    3935PASS EventTarget interface: (new XMLHttpRequest()).upload must inherit property "dispatchEvent" with the proper type (2)
    4036PASS EventTarget interface: calling dispatchEvent(Event) on (new XMLHttpRequest()).upload with too few arguments must throw TypeError
     
    115111PASS XMLHttpRequestEventTarget interface: new XMLHttpRequest() must inherit property "onloadend" with the proper type (6)
    116112PASS EventTarget interface: new XMLHttpRequest() must inherit property "addEventListener" with the proper type (0)
    117 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on new XMLHttpRequest() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    118             fn.apply(obj, args);
    119         }" did not throw
     113PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on new XMLHttpRequest() with too few arguments must throw TypeError
    120114PASS EventTarget interface: new XMLHttpRequest() must inherit property "removeEventListener" with the proper type (1)
    121 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on new XMLHttpRequest() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    122             fn.apply(obj, args);
    123         }" did not throw
     115PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on new XMLHttpRequest() with too few arguments must throw TypeError
    124116PASS EventTarget interface: new XMLHttpRequest() must inherit property "dispatchEvent" with the proper type (2)
    125117PASS EventTarget interface: calling dispatchEvent(Event) on new XMLHttpRequest() with too few arguments must throw TypeError
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt

    r203333 r203377  
    438438PASS Node interface: calling removeChild(Node) on new Document() with too few arguments must throw TypeError
    439439PASS EventTarget interface: new Document() must inherit property "addEventListener" with the proper type (0)
    440 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    441             fn.apply(obj, args);
    442         }" did not throw
     440PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on new Document() with too few arguments must throw TypeError
    443441PASS EventTarget interface: new Document() must inherit property "removeEventListener" with the proper type (1)
    444 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    445             fn.apply(obj, args);
    446         }" did not throw
     442PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on new Document() with too few arguments must throw TypeError
    447443PASS EventTarget interface: new Document() must inherit property "dispatchEvent" with the proper type (2)
    448444PASS EventTarget interface: calling dispatchEvent(Event) on new Document() with too few arguments must throw TypeError
     
    608604PASS Node interface: calling removeChild(Node) on xmlDoc with too few arguments must throw TypeError
    609605PASS EventTarget interface: xmlDoc must inherit property "addEventListener" with the proper type (0)
    610 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    611             fn.apply(obj, args);
    612         }" did not throw
     606PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc with too few arguments must throw TypeError
    613607PASS EventTarget interface: xmlDoc must inherit property "removeEventListener" with the proper type (1)
    614 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    615             fn.apply(obj, args);
    616         }" did not throw
     608PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc with too few arguments must throw TypeError
    617609PASS EventTarget interface: xmlDoc must inherit property "dispatchEvent" with the proper type (2)
    618610PASS EventTarget interface: calling dispatchEvent(Event) on xmlDoc with too few arguments must throw TypeError
     
    738730PASS Node interface: calling removeChild(Node) on document.doctype with too few arguments must throw TypeError
    739731PASS EventTarget interface: document.doctype must inherit property "addEventListener" with the proper type (0)
    740 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.doctype with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    741             fn.apply(obj, args);
    742         }" did not throw
     732PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.doctype with too few arguments must throw TypeError
    743733PASS EventTarget interface: document.doctype must inherit property "removeEventListener" with the proper type (1)
    744 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.doctype with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    745             fn.apply(obj, args);
    746         }" did not throw
     734PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.doctype with too few arguments must throw TypeError
    747735PASS EventTarget interface: document.doctype must inherit property "dispatchEvent" with the proper type (2)
    748736PASS EventTarget interface: calling dispatchEvent(Event) on document.doctype with too few arguments must throw TypeError
     
    854842PASS Node interface: calling removeChild(Node) on document.createDocumentFragment() with too few arguments must throw TypeError
    855843PASS EventTarget interface: document.createDocumentFragment() must inherit property "addEventListener" with the proper type (0)
    856 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createDocumentFragment() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    857             fn.apply(obj, args);
    858         }" did not throw
     844PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createDocumentFragment() with too few arguments must throw TypeError
    859845PASS EventTarget interface: document.createDocumentFragment() must inherit property "removeEventListener" with the proper type (1)
    860 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createDocumentFragment() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    861             fn.apply(obj, args);
    862         }" did not throw
     846PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createDocumentFragment() with too few arguments must throw TypeError
    863847PASS EventTarget interface: document.createDocumentFragment() must inherit property "dispatchEvent" with the proper type (2)
    864848PASS EventTarget interface: calling dispatchEvent(Event) on document.createDocumentFragment() with too few arguments must throw TypeError
     
    11011085PASS Node interface: calling removeChild(Node) on element with too few arguments must throw TypeError
    11021086PASS EventTarget interface: element must inherit property "addEventListener" with the proper type (0)
    1103 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on element with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1104             fn.apply(obj, args);
    1105         }" did not throw
     1087PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on element with too few arguments must throw TypeError
    11061088PASS EventTarget interface: element must inherit property "removeEventListener" with the proper type (1)
    1107 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on element with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1108             fn.apply(obj, args);
    1109         }" did not throw
     1089PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on element with too few arguments must throw TypeError
    11101090PASS EventTarget interface: element must inherit property "dispatchEvent" with the proper type (2)
    11111091PASS EventTarget interface: calling dispatchEvent(Event) on element with too few arguments must throw TypeError
     
    12821262PASS Node interface: calling removeChild(Node) on document.createTextNode("abc") with too few arguments must throw TypeError
    12831263PASS EventTarget interface: document.createTextNode("abc") must inherit property "addEventListener" with the proper type (0)
    1284 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createTextNode("abc") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1285             fn.apply(obj, args);
    1286         }" did not throw
     1264PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createTextNode("abc") with too few arguments must throw TypeError
    12871265PASS EventTarget interface: document.createTextNode("abc") must inherit property "removeEventListener" with the proper type (1)
    1288 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createTextNode("abc") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1289             fn.apply(obj, args);
    1290         }" did not throw
     1266PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createTextNode("abc") with too few arguments must throw TypeError
    12911267PASS EventTarget interface: document.createTextNode("abc") must inherit property "dispatchEvent" with the proper type (2)
    12921268PASS EventTarget interface: calling dispatchEvent(Event) on document.createTextNode("abc") with too few arguments must throw TypeError
     
    13961372PASS Node interface: calling removeChild(Node) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError
    13971373PASS EventTarget interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "addEventListener" with the proper type (0)
    1398 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1399             fn.apply(obj, args);
    1400         }" did not throw
     1374PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError
    14011375PASS EventTarget interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "removeEventListener" with the proper type (1)
    1402 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1403             fn.apply(obj, args);
    1404         }" did not throw
     1376PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError
    14051377PASS EventTarget interface: xmlDoc.createProcessingInstruction("abc", "def") must inherit property "dispatchEvent" with the proper type (2)
    14061378PASS EventTarget interface: calling dispatchEvent(Event) on xmlDoc.createProcessingInstruction("abc", "def") with too few arguments must throw TypeError
     
    15081480PASS Node interface: calling removeChild(Node) on document.createComment("abc") with too few arguments must throw TypeError
    15091481PASS EventTarget interface: document.createComment("abc") must inherit property "addEventListener" with the proper type (0)
    1510 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createComment("abc") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1511             fn.apply(obj, args);
    1512         }" did not throw
     1482PASS EventTarget interface: calling addEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createComment("abc") with too few arguments must throw TypeError
    15131483PASS EventTarget interface: document.createComment("abc") must inherit property "removeEventListener" with the proper type (1)
    1514 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createComment("abc") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1515             fn.apply(obj, args);
    1516         }" did not throw
     1484PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,[object Object],[object Object]) on document.createComment("abc") with too few arguments must throw TypeError
    15171485PASS EventTarget interface: document.createComment("abc") must inherit property "dispatchEvent" with the proper type (2)
    15181486PASS EventTarget interface: calling dispatchEvent(Event) on document.createComment("abc") with too few arguments must throw TypeError
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt

    r203333 r203377  
    419419PASS Node interface: calling removeChild(Node) on iframe.contentDocument with too few arguments must throw TypeError
    420420PASS EventTarget interface: iframe.contentDocument must inherit property "addEventListener" with the proper type (0)
    421 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    422             fn.apply(obj, args);
    423         }" did not throw
     421PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on iframe.contentDocument with too few arguments must throw TypeError
    424422PASS EventTarget interface: iframe.contentDocument must inherit property "removeEventListener" with the proper type (1)
    425 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on iframe.contentDocument with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    426             fn.apply(obj, args);
    427         }" did not throw
     423PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on iframe.contentDocument with too few arguments must throw TypeError
    428424PASS EventTarget interface: iframe.contentDocument must inherit property "dispatchEvent" with the proper type (2)
    429425PASS EventTarget interface: calling dispatchEvent(Event) on iframe.contentDocument with too few arguments must throw TypeError
     
    725721PASS Node interface: calling removeChild(Node) on new Document() with too few arguments must throw TypeError
    726722PASS EventTarget interface: new Document() must inherit property "addEventListener" with the proper type (0)
    727 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    728             fn.apply(obj, args);
    729         }" did not throw
     723PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on new Document() with too few arguments must throw TypeError
    730724PASS EventTarget interface: new Document() must inherit property "removeEventListener" with the proper type (1)
    731 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on new Document() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    732             fn.apply(obj, args);
    733         }" did not throw
     725PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on new Document() with too few arguments must throw TypeError
    734726PASS EventTarget interface: new Document() must inherit property "dispatchEvent" with the proper type (2)
    735727PASS EventTarget interface: calling dispatchEvent(Event) on new Document() with too few arguments must throw TypeError
     
    10341026PASS Node interface: calling removeChild(Node) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError
    10351027PASS EventTarget interface: document.implementation.createDocument(null, "", null) must inherit property "addEventListener" with the proper type (0)
    1036 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1037             fn.apply(obj, args);
    1038         }" did not throw
     1028PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError
    10391029PASS EventTarget interface: document.implementation.createDocument(null, "", null) must inherit property "removeEventListener" with the proper type (1)
    1040 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1041             fn.apply(obj, args);
    1042         }" did not throw
     1030PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError
    10431031PASS EventTarget interface: document.implementation.createDocument(null, "", null) must inherit property "dispatchEvent" with the proper type (2)
    10441032PASS EventTarget interface: calling dispatchEvent(Event) on document.implementation.createDocument(null, "", null) with too few arguments must throw TypeError
     
    14661454PASS Node interface: calling removeChild(Node) on document.createElement("noscript") with too few arguments must throw TypeError
    14671455PASS EventTarget interface: document.createElement("noscript") must inherit property "addEventListener" with the proper type (0)
    1468 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on document.createElement("noscript") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1469             fn.apply(obj, args);
    1470         }" did not throw
     1456PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on document.createElement("noscript") with too few arguments must throw TypeError
    14711457PASS EventTarget interface: document.createElement("noscript") must inherit property "removeEventListener" with the proper type (1)
    1472 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on document.createElement("noscript") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    1473             fn.apply(obj, args);
    1474         }" did not throw
     1458PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on document.createElement("noscript") with too few arguments must throw TypeError
    14751459PASS EventTarget interface: document.createElement("noscript") must inherit property "dispatchEvent" with the proper type (2)
    14761460PASS EventTarget interface: calling dispatchEvent(Event) on document.createElement("noscript") with too few arguments must throw TypeError
     
    24422426FAIL MediaController interface: new MediaController() must inherit property "onvolumechange" with the proper type (28) assert_inherits: property "onvolumechange" not found in prototype chain
    24432427PASS EventTarget interface: new MediaController() must inherit property "addEventListener" with the proper type (0)
    2444 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on new MediaController() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    2445             fn.apply(obj, args);
    2446         }" did not throw
     2428PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on new MediaController() with too few arguments must throw TypeError
    24472429PASS EventTarget interface: new MediaController() must inherit property "removeEventListener" with the proper type (1)
    2448 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on new MediaController() with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    2449             fn.apply(obj, args);
    2450         }" did not throw
     2430PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on new MediaController() with too few arguments must throw TypeError
    24512431PASS EventTarget interface: new MediaController() must inherit property "dispatchEvent" with the proper type (2)
    24522432PASS EventTarget interface: calling dispatchEvent(Event) on new MediaController() with too few arguments must throw TypeError
     
    24702450PASS TextTrackList interface: document.createElement("video").textTracks must inherit property "onremovetrack" with the proper type (5)
    24712451PASS EventTarget interface: document.createElement("video").textTracks must inherit property "addEventListener" with the proper type (0)
    2472 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on document.createElement("video").textTracks with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    2473             fn.apply(obj, args);
    2474         }" did not throw
     2452PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on document.createElement("video").textTracks with too few arguments must throw TypeError
    24752453PASS EventTarget interface: document.createElement("video").textTracks must inherit property "removeEventListener" with the proper type (1)
    2476 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on document.createElement("video").textTracks with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    2477             fn.apply(obj, args);
    2478         }" did not throw
     2454PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on document.createElement("video").textTracks with too few arguments must throw TypeError
    24792455PASS EventTarget interface: document.createElement("video").textTracks must inherit property "dispatchEvent" with the proper type (2)
    24802456PASS EventTarget interface: calling dispatchEvent(Event) on document.createElement("video").textTracks with too few arguments must throw TypeError
     
    25152491PASS TextTrack interface: document.createElement("track").track must inherit property "oncuechange" with the proper type (10)
    25162492PASS EventTarget interface: document.createElement("track").track must inherit property "addEventListener" with the proper type (0)
    2517 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on document.createElement("track").track with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    2518             fn.apply(obj, args);
    2519         }" did not throw
     2493PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on document.createElement("track").track with too few arguments must throw TypeError
    25202494PASS EventTarget interface: document.createElement("track").track must inherit property "removeEventListener" with the proper type (1)
    2521 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on document.createElement("track").track with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    2522             fn.apply(obj, args);
    2523         }" did not throw
     2495PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on document.createElement("track").track with too few arguments must throw TypeError
    25242496PASS EventTarget interface: document.createElement("track").track must inherit property "dispatchEvent" with the proper type (2)
    25252497PASS EventTarget interface: calling dispatchEvent(Event) on document.createElement("track").track with too few arguments must throw TypeError
     
    56955667PASS Window interface: window must inherit property "localStorage" with the proper type (124)
    56965668PASS EventTarget interface: window must inherit property "addEventListener" with the proper type (0)
    5697 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on window with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    5698             fn.apply(obj, args);
    5699         }" did not throw
     5669PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on window with too few arguments must throw TypeError
    57005670PASS EventTarget interface: window must inherit property "removeEventListener" with the proper type (1)
    5701 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on window with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    5702             fn.apply(obj, args);
    5703         }" did not throw
     5671PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on window with too few arguments must throw TypeError
    57045672PASS EventTarget interface: window must inherit property "dispatchEvent" with the proper type (2)
    57055673PASS EventTarget interface: calling dispatchEvent(Event) on window with too few arguments must throw TypeError
     
    58605828PASS ApplicationCache interface: window.applicationCache must inherit property "onobsolete" with the proper type (17)
    58615829PASS EventTarget interface: window.applicationCache must inherit property "addEventListener" with the proper type (0)
    5862 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on window.applicationCache with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    5863             fn.apply(obj, args);
    5864         }" did not throw
     5830PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on window.applicationCache with too few arguments must throw TypeError
    58655831PASS EventTarget interface: window.applicationCache must inherit property "removeEventListener" with the proper type (1)
    5866 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on window.applicationCache with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    5867             fn.apply(obj, args);
    5868         }" did not throw
     5832PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on window.applicationCache with too few arguments must throw TypeError
    58695833PASS EventTarget interface: window.applicationCache must inherit property "dispatchEvent" with the proper type (2)
    58705834PASS EventTarget interface: calling dispatchEvent(Event) on window.applicationCache with too few arguments must throw TypeError
     
    60776041PASS WebSocket interface: calling send(ArrayBufferView) on new WebSocket("ws://foo") with too few arguments must throw TypeError
    60786042PASS EventTarget interface: new WebSocket("ws://foo") must inherit property "addEventListener" with the proper type (0)
    6079 FAIL EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on new WebSocket("ws://foo") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    6080             fn.apply(obj, args);
    6081         }" did not throw
     6043PASS EventTarget interface: calling addEventListener(DOMString,EventListener,boolean) on new WebSocket("ws://foo") with too few arguments must throw TypeError
    60826044PASS EventTarget interface: new WebSocket("ws://foo") must inherit property "removeEventListener" with the proper type (1)
    6083 FAIL EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on new WebSocket("ws://foo") with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
    6084             fn.apply(obj, args);
    6085         }" did not throw
     6045PASS EventTarget interface: calling removeEventListener(DOMString,EventListener,boolean) on new WebSocket("ws://foo") with too few arguments must throw TypeError
    60866046PASS EventTarget interface: new WebSocket("ws://foo") must inherit property "dispatchEvent" with the proper type (2)
    60876047PASS EventTarget interface: calling dispatchEvent(Event) on new WebSocket("ws://foo") with too few arguments must throw TypeError
  • trunk/LayoutTests/media/video-remote-control-playpause.html

    r165916 r203377  
    132132                    video.addEventListener('pause', pause);
    133133                    video.addEventListener('seeked', seeked);
    134                     video.addEventListener('ended');
    135134                    video.src = findMediaFile("video", "content/test");
    136135                }
  • trunk/Source/WebCore/ChangeLog

    r203374 r203377  
     12016-07-18  Chris Dumez  <cdumez@apple.com>
     2
     3        The 2 first parameters to addEventListener() / removeEventListener() should be mandatory
     4        https://bugs.webkit.org/show_bug.cgi?id=158008
     5
     6        Reviewed by Darin Adler.
     7
     8        The 2 first parameters to addEventListener() / removeEventListener() should be
     9        mandatory:
     10        - https://dom.spec.whatwg.org/#interface-eventtarget
     11
     12        Firefox 46 and Chrome 50 both match the specification and throw an exception when those
     13        parameters are omitted. However, those parameters were marked as optional in WebKit and
     14        the calls were no-ops if those parameters were omitted. This patch aligns our behavior
     15        with the specification and other browsers.
     16
     17        Test: fast/dom/eventtarget-api-parameters.html
     18
     19        * bindings/scripts/CodeGeneratorJS.pm:
     20        (GetFunctionLength): Deleted.
     21        * dom/EventTarget.idl:
     22
    1232016-07-18  Brent Fulgham  <bfulgham@apple.com>
    224
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r203222 r203377  
    17221722{
    17231723    my $function = shift;
    1724 
    1725     # FIXME: EventTarget.addEventListener() / removeEventListener() currently specifies all the parameters as optional.
    1726     return 2 if $function->signature->name eq "addEventListener" || $function->signature->name eq "removeEventListener";
    17271724
    17281725    my $length = 0;
  • trunk/Source/WebCore/dom/EventTarget.idl

    r201791 r203377  
    3232#endif
    3333
    34     // FIXME: The 'type' and 'listener' parameters should not be optional.
    35     [ObjCLegacyUnnamedParameters, ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] optional DOMString type = "undefined", optional EventListener? listener, optional boolean useCapture = false);
    36     [ObjCLegacyUnnamedParameters, ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] optional DOMString type = "undefined", optional EventListener? listener, optional boolean useCapture = false);
     34    [ObjCLegacyUnnamedParameters, ImplementedAs=addEventListenerForBindings] void addEventListener([AtomicString] DOMString type, EventListener? listener, optional boolean useCapture = false);
     35    [ObjCLegacyUnnamedParameters, ImplementedAs=removeEventListenerForBindings] void removeEventListener([AtomicString] DOMString type, EventListener? listener, optional boolean useCapture = false);
    3736
    3837    // FIXME: event should not be nullable.
Note: See TracChangeset for help on using the changeset viewer.