EventTarget.dispatchEvent() parameter should not be nullable
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jul 2016 01:18:06 +0000 (01:18 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jul 2016 01:18:06 +0000 (01:18 +0000)
commit0a65d0684c580e430383bc80fa38d33ebc667361
treefc192d0b2bbf2052bfd9845c485b7f1b03e0003c
parent4d3d63b3ae0b8b0bc9c77008f84e2381c7d345a1
EventTarget.dispatchEvent() parameter should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=159897

Reviewed by Benjamin Poulain.

Source/WebCore:

EventTarget.dispatchEvent() parameter should not be nullable:
- https://dom.spec.whatwg.org/#interface-eventtarget

Even though the parameter was marked as nullable in our IDL, our
implementation does a null check and we already throw a TypeError
when calling dispatchEvent(null).

Update our IDL so that it matches the specification and so that
the null check is generated in the bindings instead.

No new tests, rebaseline existing tests.

* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEventForBindings):
* dom/EventTarget.h:
* dom/EventTarget.idl:

LayoutTests:

Update layout tests as the message of the TypeError exception being
thrown when calling dispatchEvent(null) is now more helpful.

* fast/dom/Window/dispatchEvent-expected.txt:
* fast/events/dispatchEvent-crash-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/dispatchEvent-expected.txt
LayoutTests/fast/events/dispatchEvent-crash-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestNode.cpp
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/dom/EventTarget.h
Source/WebCore/dom/EventTarget.idl
Source/WebKit/win/DOMCoreClasses.cpp