Changeset 196466 in webkit


Ignore:
Timestamp:
Feb 11, 2016 11:28:32 PM (8 years ago)
Author:
Chris Dumez
Message:

[Web IDL] interfaces should inherit EventTarget instead of duplicating the EventTarget API
https://bugs.webkit.org/show_bug.cgi?id=154121
<rdar://problem/24613234>

Reviewed by Gavin Barraclough.

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:

Interfaces should inherit EventTarget instead of duplicating the
EventTarget API in their IDL. Not only the duplication is ugly and
error-prone, but this also does not match the specifications and
have subtle web-exposed differences.

This patch takes care of all interfaces except for DOMWindow and
WorkerGlobalScope. Those will be updated in the follow-up patch
as they will require a little bit more work and testing.

We should also be able to get rid of the [EventTarget] WebKit IDL
attribute in a follow-up.

No new tests, already covered by existing tests.

  • Modules/battery/BatteryManager.idl:
  • Modules/encryptedmedia/MediaKeySession.idl:
  • Modules/indexeddb/IDBDatabase.h:
  • Modules/indexeddb/IDBDatabase.idl:
  • Modules/indexeddb/IDBRequest.h:
  • Modules/indexeddb/IDBRequest.idl:
  • Modules/indexeddb/IDBTransaction.h:
  • Modules/indexeddb/IDBTransaction.idl:
  • Modules/mediasession/MediaRemoteControls.idl:
  • Modules/mediasource/MediaSource.h:
  • Modules/mediasource/MediaSource.idl:
  • Modules/mediasource/SourceBuffer.h:
  • Modules/mediasource/SourceBuffer.idl:
  • Modules/mediasource/SourceBufferList.h:
  • Modules/mediasource/SourceBufferList.idl:
  • Modules/mediastream/MediaStream.h:
  • Modules/mediastream/MediaStream.idl:
  • Modules/mediastream/MediaStreamTrack.h:
  • Modules/mediastream/MediaStreamTrack.idl:
  • Modules/mediastream/RTCDTMFSender.h:
  • Modules/mediastream/RTCDTMFSender.idl:
  • Modules/mediastream/RTCDataChannel.h:
  • Modules/mediastream/RTCDataChannel.idl:
  • Modules/mediastream/RTCPeerConnection.h:
  • Modules/mediastream/RTCPeerConnection.idl:
  • Modules/notifications/Notification.idl:
  • Modules/speech/SpeechSynthesisUtterance.idl:
  • Modules/webaudio/AudioContext.idl:
  • Modules/webaudio/AudioNode.idl:
  • Modules/websockets/WebSocket.idl:
  • css/FontLoader.idl:
  • dom/EventTarget.h:
  • dom/MessagePort.idl:
  • dom/Node.h:
  • dom/Node.idl:
  • dom/WebKitNamedFlow.idl:
  • fileapi/FileReader.idl:
  • html/MediaController.idl:
  • html/track/AudioTrackList.idl:
  • html/track/TextTrack.idl:
  • html/track/TextTrackCue.idl:
  • html/track/TextTrackList.idl:
  • html/track/VideoTrackList.idl:
  • loader/appcache/DOMApplicationCache.h:
  • loader/appcache/DOMApplicationCache.idl:
  • page/EventSource.idl:
  • page/Performance.h:
  • page/Performance.idl:
  • workers/Worker.idl:
  • xml/XMLHttpRequest.h:
  • xml/XMLHttpRequest.idl:
  • xml/XMLHttpRequestUpload.idl:
  • Drop hardcoded EventTarget operations and inherit EventTarget instead.
  • Drop JSGenerateToNativeObject / JSGenerateToJSObject IDL extended attributes for interfaces inheriting the EventTarget interface as the bindings generator now does this automatically for us.
  • On native side, have EventTarget subclass ScriptWrappable instead of each of its subclasses doing so. The issue was that EventTargetOwner::finalize() was calling uncacheWrapper() with an EventTarget*, which would not clear inlined cached wrapped (see clearInlineCachedWrapper()) because EventTarget did not subclass ScriptWrappable. However, cacheWrapper() is called is a specific subtype pointer (e.g. Node*) and we would decide to create an inline cached wrapper because Node subclassed ScriptWrappable (as well as EventTarget).
  • WebCore.xcodeproj/project.pbxproj:

Export JSEventTarget.h as private header to fix the build.

  • bindings/js/JSDOMBinding.h:

(WebCore::wrapperKey):
(WebCore::getCachedWrapper):
(WebCore::cacheWrapper):
(WebCore::uncacheWrapper):
Use new wrapperKey() function that is generated for each bindings
class that also has wrapperOwner(). This is used instead of the
C cast to void* in order to cast to the base wrapped type to fix
issues with multiple inheritance. The issue was that cacheWrapper()
was getting called with a DOM object subtype pointer (e.g.
AudioContext*) but uncacheWrapper() was getting called with a base
wrapped type pointer (e.g. EventTarget*). Most of our DOM classes
use multiple inheritance and thus the pointer values (used as keys
in the weak map) may differ.

  • bindings/js/JSTrackCustom.cpp:

(WebCore::toJS):
Call CREATE_DOM_WRAPPER() with an actual wrapped type (e.g. AudioTrack)
instead of TrackBase type. TrackBase does not have corresponding
generated bindings and therefore does not have a wrapperKey()
function.

  • bindings/scripts/CodeGeneratorJS.pm:

(ShouldGenerateToWrapped):
(ShouldGenerateToJSDeclaration):
(GenerateHeader):

  • Generate a wrapperKey() utility function along-side wrapperOwner() to help cast to the base wrapped type.
  • Generate toWrapped() / toJS() utility functions for interfaces that inherit EventTarget as those are required by our implementation and this avoids having to explicitly have them in the IDL.
  • bindings/scripts/test/*:

Rebaseline bindings tests.

LayoutTests:

Rebaseline a couple of layout tests now that interfaces inherit EventTarget
instead of duplicating the EventTarget API in their IDL.

  • fast/dom/Window/window-properties-performance-expected.txt:
  • fast/dom/prototype-chain-expected.txt:
Location:
trunk
Files:
88 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r196439 r196466  
     12016-02-11  Chris Dumez  <cdumez@apple.com>
     2
     3        [Web IDL] interfaces should inherit EventTarget instead of duplicating the EventTarget API
     4        https://bugs.webkit.org/show_bug.cgi?id=154121
     5        <rdar://problem/24613234>
     6
     7        Reviewed by Gavin Barraclough.
     8
     9        Rebaseline a couple of layout tests now that interfaces inherit EventTarget
     10        instead of duplicating the EventTarget API in their IDL.
     11
     12        * fast/dom/Window/window-properties-performance-expected.txt:
     13        * fast/dom/prototype-chain-expected.txt:
     14
    1152016-02-11  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/LayoutTests/fast/dom/Window/window-properties-performance-expected.txt

    r151199 r196466  
    22
    33window.performance [object Performance]
     4window.performance.addEventListener [function]
     5window.performance.dispatchEvent [function]
    46window.performance.navigation [object PerformanceNavigation]
    57window.performance.navigation.TYPE_BACK_FORWARD [number]
     
    1012window.performance.navigation.type [number]
    1113window.performance.now [function]
     14window.performance.removeEventListener [function]
    1215window.performance.timing [object PerformanceTiming]
    1316window.performance.timing.connectEnd [number]
  • trunk/LayoutTests/fast/dom/prototype-chain-expected.txt

    r40672 r196466  
    33NOTE: This test will start failing if you change the layout of a related prototype chain in WebCore. That does not necessarily mean that you have done something wrong; you may just need to check in new results.
    44
    5 ----- [object HTMLDocument] (4 prototypes) -----
     5----- [object HTMLDocument] (5 prototypes) -----
    66
    77[object Object]
     8
     9[object EventTargetPrototype]
    810
    911[object NodePrototype]
     
    1315[object HTMLDocumentPrototype]
    1416
    15 ----- [object HTMLDivElement] (5 prototypes) -----
     17----- [object HTMLDivElement] (6 prototypes) -----
    1618
    1719[object Object]
     20
     21[object EventTargetPrototype]
    1822
    1923[object NodePrototype]
     
    2529[object HTMLDivElementPrototype]
    2630
    27 ----- [object HTMLFormElement] (5 prototypes) -----
     31----- [object HTMLFormElement] (6 prototypes) -----
    2832
    2933[object Object]
     34
     35[object EventTargetPrototype]
    3036
    3137[object NodePrototype]
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r196423 r196466  
     12016-02-11  Chris Dumez  <cdumez@apple.com>
     2
     3        [Web IDL] interfaces should inherit EventTarget instead of duplicating the EventTarget API
     4        https://bugs.webkit.org/show_bug.cgi?id=154121
     5        <rdar://problem/24613234>
     6
     7        Reviewed by Gavin Barraclough.
     8
     9        Rebaseline several W3C tests now that more checks are passing.
     10
     11        * web-platform-tests/dom/interfaces-expected.txt:
     12        * web-platform-tests/html/dom/interfaces-expected.txt:
     13
    1142016-02-11  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt

    r196423 r196466  
    171171PASS MutationRecord interface: attribute attributeNamespace
    172172PASS MutationRecord interface: attribute oldValue
    173 FAIL Node interface: existence and properties of interface object assert_equals: prototype of Node is not EventTarget expected function "function EventTarget() {
    174     [native code]
    175 }" but got function "function () {
    176     [native code]
    177 }"
     173PASS Node interface: existence and properties of interface object
    178174PASS Node interface object length
    179175PASS Node interface object name
    180 FAIL Node interface: existence and properties of interface prototype object assert_equals: prototype of Node.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
     176PASS Node interface: existence and properties of interface prototype object
    181177PASS Node interface: existence and properties of interface prototype object's "constructor" property
    182178PASS Node interface: constant ELEMENT_NODE on interface object
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt

    r196423 r196466  
    22342234FAIL VideoTrack interface: attribute language assert_own_property: self does not have own property "VideoTrack" expected property "VideoTrack" missing
    22352235FAIL VideoTrack interface: attribute selected assert_own_property: self does not have own property "VideoTrack" expected property "VideoTrack" missing
    2236 FAIL MediaController interface: existence and properties of interface object assert_equals: prototype of MediaController is not EventTarget expected function "function EventTarget() {
    2237     [native code]
    2238 }" but got function "function () {
    2239     [native code]
    2240 }"
     2236PASS MediaController interface: existence and properties of interface object
    22412237PASS MediaController interface object length
    22422238PASS MediaController interface object name
    2243 FAIL MediaController interface: existence and properties of interface prototype object assert_equals: prototype of MediaController.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
     2239PASS MediaController interface: existence and properties of interface prototype object
    22442240PASS MediaController interface: existence and properties of interface prototype object's "constructor" property
    22452241FAIL MediaController interface: attribute readyState assert_true: The prototype object must have a property "readyState" expected true got false
     
    23132309PASS EventTarget interface: new MediaController() must inherit property "dispatchEvent" with the proper type (2)
    23142310PASS EventTarget interface: calling dispatchEvent(Event) on new MediaController() with too few arguments must throw TypeError
    2315 FAIL TextTrackList interface: existence and properties of interface object assert_equals: prototype of TextTrackList is not EventTarget expected function "function EventTarget() {
    2316     [native code]
    2317 }" but got function "function () {
    2318     [native code]
    2319 }"
     2311PASS TextTrackList interface: existence and properties of interface object
    23202312PASS TextTrackList interface object length
    23212313PASS TextTrackList interface object name
    2322 FAIL TextTrackList interface: existence and properties of interface prototype object assert_equals: prototype of TextTrackList.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
     2314PASS TextTrackList interface: existence and properties of interface prototype object
    23232315PASS TextTrackList interface: existence and properties of interface prototype object's "constructor" property
    23242316PASS TextTrackList interface: attribute length
     
    23452337PASS EventTarget interface: document.createElement("video").textTracks must inherit property "dispatchEvent" with the proper type (2)
    23462338PASS EventTarget interface: calling dispatchEvent(Event) on document.createElement("video").textTracks with too few arguments must throw TypeError
    2347 FAIL TextTrack interface: existence and properties of interface object assert_equals: prototype of TextTrack is not EventTarget expected function "function EventTarget() {
    2348     [native code]
    2349 }" but got function "function () {
    2350     [native code]
    2351 }"
     2339PASS TextTrack interface: existence and properties of interface object
    23522340PASS TextTrack interface object length
    23532341PASS TextTrack interface object name
    2354 FAIL TextTrack interface: existence and properties of interface prototype object assert_equals: prototype of TextTrack.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
     2342PASS TextTrack interface: existence and properties of interface prototype object
    23552343PASS TextTrack interface: existence and properties of interface prototype object's "constructor" property
    23562344FAIL TextTrack interface: attribute kind assert_equals: setter must be undefined for readonly attributes expected (undefined) undefined but got (function) function "function kind() {
     
    24062394PASS TextTrackCueList interface: document.createElement("video").addTextTrack("subtitles").cues must inherit property "getCueById" with the proper type (2)
    24072395PASS TextTrackCueList interface: calling getCueById(DOMString) on document.createElement("video").addTextTrack("subtitles").cues with too few arguments must throw TypeError
    2408 FAIL TextTrackCue interface: existence and properties of interface object assert_equals: prototype of TextTrackCue is not EventTarget expected function "function EventTarget() {
    2409     [native code]
    2410 }" but got function "function () {
    2411     [native code]
    2412 }"
     2396PASS TextTrackCue interface: existence and properties of interface object
    24132397FAIL TextTrackCue interface object length assert_equals: wrong value for TextTrackCue.length expected 0 but got 3
    24142398PASS TextTrackCue interface object name
    2415 FAIL TextTrackCue interface: existence and properties of interface prototype object assert_equals: prototype of TextTrackCue.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
     2399PASS TextTrackCue interface: existence and properties of interface prototype object
    24162400PASS TextTrackCue interface: existence and properties of interface prototype object's "constructor" property
    24172401PASS TextTrackCue interface: attribute track
     
    42094193PASS BeforeUnloadEvent interface: existence and properties of interface prototype object's "constructor" property
    42104194PASS BeforeUnloadEvent interface: attribute returnValue
    4211 FAIL ApplicationCache interface: existence and properties of interface object assert_equals: prototype of ApplicationCache is not EventTarget expected function "function EventTarget() {
    4212     [native code]
    4213 }" but got function "function () {
    4214     [native code]
    4215 }"
     4195PASS ApplicationCache interface: existence and properties of interface object
    42164196PASS ApplicationCache interface object length
    42174197PASS ApplicationCache interface object name
    4218 FAIL ApplicationCache interface: existence and properties of interface prototype object assert_equals: prototype of ApplicationCache.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
     4198PASS ApplicationCache interface: existence and properties of interface prototype object
    42194199PASS ApplicationCache interface: existence and properties of interface prototype object's "constructor" property
    42204200PASS ApplicationCache interface: constant UNCACHED on interface object
     
    44074387PASS MessageEvent interface: attribute ports
    44084388FAIL MessageEvent interface: operation initMessageEvent(DOMString,boolean,boolean,any,DOMString,DOMString,[object Object],[object Object],MessagePort) assert_equals: property has wrong .length expected 8 but got 0
    4409 FAIL EventSource interface: existence and properties of interface object assert_equals: prototype of EventSource is not EventTarget expected function "function EventTarget() {
    4410     [native code]
    4411 }" but got function "function () {
    4412     [native code]
    4413 }"
     4389PASS EventSource interface: existence and properties of interface object
    44144390PASS EventSource interface object length
    44154391PASS EventSource interface object name
    4416 FAIL EventSource interface: existence and properties of interface prototype object assert_equals: prototype of EventSource.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
     4392PASS EventSource interface: existence and properties of interface prototype object
    44174393PASS EventSource interface: existence and properties of interface prototype object's "constructor" property
    44184394PASS EventSource interface: attribute url
     
    44294405PASS EventSource interface: attribute onerror
    44304406PASS EventSource interface: operation close()
    4431 FAIL WebSocket interface: existence and properties of interface object assert_equals: prototype of WebSocket is not EventTarget expected function "function EventTarget() {
    4432     [native code]
    4433 }" but got function "function () {
    4434     [native code]
    4435 }"
     4407PASS WebSocket interface: existence and properties of interface object
    44364408PASS WebSocket interface object length
    44374409PASS WebSocket interface object name
    4438 FAIL WebSocket interface: existence and properties of interface prototype object assert_equals: prototype of WebSocket.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
     4410PASS WebSocket interface: existence and properties of interface prototype object
    44394411PASS WebSocket interface: existence and properties of interface prototype object's "constructor" property
    44404412PASS WebSocket interface: attribute url
     
    45374509PASS MessageChannel interface: attribute port1
    45384510PASS MessageChannel interface: attribute port2
    4539 FAIL MessagePort interface: existence and properties of interface object assert_equals: prototype of MessagePort is not EventTarget expected function "function EventTarget() {
    4540     [native code]
    4541 }" but got function "function () {
    4542     [native code]
    4543 }"
     4511PASS MessagePort interface: existence and properties of interface object
    45444512PASS MessagePort interface object length
    45454513PASS MessagePort interface object name
    4546 FAIL MessagePort interface: existence and properties of interface prototype object assert_equals: prototype of MessagePort.prototype is not EventTarget.prototype expected object "[object EventTargetPrototype]" but got object "[object Object]"
     4514PASS MessagePort interface: existence and properties of interface prototype object
    45474515PASS MessagePort interface: existence and properties of interface prototype object's "constructor" property
    45484516PASS MessagePort interface: operation postMessage(any,[object Object])
  • trunk/Source/WebCore/ChangeLog

    r196460 r196466  
     12016-02-11  Chris Dumez  <cdumez@apple.com>
     2
     3        [Web IDL] interfaces should inherit EventTarget instead of duplicating the EventTarget API
     4        https://bugs.webkit.org/show_bug.cgi?id=154121
     5        <rdar://problem/24613234>
     6
     7        Reviewed by Gavin Barraclough.
     8
     9        Interfaces should inherit EventTarget instead of duplicating the
     10        EventTarget API in their IDL. Not only the duplication is ugly and
     11        error-prone, but this also does not match the specifications and
     12        have subtle web-exposed differences.
     13
     14        This patch takes care of all interfaces except for DOMWindow and
     15        WorkerGlobalScope. Those will be updated in the follow-up patch
     16        as they will require a little bit more work and testing.
     17
     18        We should also be able to get rid of the [EventTarget] WebKit IDL
     19        attribute in a follow-up.
     20
     21        No new tests, already covered by existing tests.
     22
     23        * Modules/battery/BatteryManager.idl:
     24        * Modules/encryptedmedia/MediaKeySession.idl:
     25        * Modules/indexeddb/IDBDatabase.h:
     26        * Modules/indexeddb/IDBDatabase.idl:
     27        * Modules/indexeddb/IDBRequest.h:
     28        * Modules/indexeddb/IDBRequest.idl:
     29        * Modules/indexeddb/IDBTransaction.h:
     30        * Modules/indexeddb/IDBTransaction.idl:
     31        * Modules/mediasession/MediaRemoteControls.idl:
     32        * Modules/mediasource/MediaSource.h:
     33        * Modules/mediasource/MediaSource.idl:
     34        * Modules/mediasource/SourceBuffer.h:
     35        * Modules/mediasource/SourceBuffer.idl:
     36        * Modules/mediasource/SourceBufferList.h:
     37        * Modules/mediasource/SourceBufferList.idl:
     38        * Modules/mediastream/MediaStream.h:
     39        * Modules/mediastream/MediaStream.idl:
     40        * Modules/mediastream/MediaStreamTrack.h:
     41        * Modules/mediastream/MediaStreamTrack.idl:
     42        * Modules/mediastream/RTCDTMFSender.h:
     43        * Modules/mediastream/RTCDTMFSender.idl:
     44        * Modules/mediastream/RTCDataChannel.h:
     45        * Modules/mediastream/RTCDataChannel.idl:
     46        * Modules/mediastream/RTCPeerConnection.h:
     47        * Modules/mediastream/RTCPeerConnection.idl:
     48        * Modules/notifications/Notification.idl:
     49        * Modules/speech/SpeechSynthesisUtterance.idl:
     50        * Modules/webaudio/AudioContext.idl:
     51        * Modules/webaudio/AudioNode.idl:
     52        * Modules/websockets/WebSocket.idl:
     53        * css/FontLoader.idl:
     54        * dom/EventTarget.h:
     55        * dom/MessagePort.idl:
     56        * dom/Node.h:
     57        * dom/Node.idl:
     58        * dom/WebKitNamedFlow.idl:
     59        * fileapi/FileReader.idl:
     60        * html/MediaController.idl:
     61        * html/track/AudioTrackList.idl:
     62        * html/track/TextTrack.idl:
     63        * html/track/TextTrackCue.idl:
     64        * html/track/TextTrackList.idl:
     65        * html/track/VideoTrackList.idl:
     66        * loader/appcache/DOMApplicationCache.h:
     67        * loader/appcache/DOMApplicationCache.idl:
     68        * page/EventSource.idl:
     69        * page/Performance.h:
     70        * page/Performance.idl:
     71        * workers/Worker.idl:
     72        * xml/XMLHttpRequest.h:
     73        * xml/XMLHttpRequest.idl:
     74        * xml/XMLHttpRequestUpload.idl:
     75        - Drop hardcoded EventTarget operations and inherit EventTarget instead.
     76        - Drop JSGenerateToNativeObject / JSGenerateToJSObject IDL extended
     77          attributes for interfaces inheriting the EventTarget interface as
     78          the bindings generator now does this automatically for us.
     79        - On native side, have EventTarget subclass ScriptWrappable instead of
     80          each of its subclasses doing so. The issue was that
     81          EventTargetOwner::finalize() was calling uncacheWrapper() with an
     82          EventTarget*, which would not clear inlined cached wrapped (see
     83          clearInlineCachedWrapper()) because EventTarget did not subclass
     84          ScriptWrappable. However, cacheWrapper() is called is a specific
     85          subtype pointer (e.g. Node*) and we would decide to create an
     86          inline cached wrapper because Node subclassed ScriptWrappable
     87          (as well as EventTarget).
     88
     89        * WebCore.xcodeproj/project.pbxproj:
     90        Export JSEventTarget.h as private header to fix the build.
     91
     92        * bindings/js/JSDOMBinding.h:
     93        (WebCore::wrapperKey):
     94        (WebCore::getCachedWrapper):
     95        (WebCore::cacheWrapper):
     96        (WebCore::uncacheWrapper):
     97        Use new wrapperKey() function that is generated for each bindings
     98        class that also has wrapperOwner(). This is used instead of the
     99        C cast to void* in order to cast to the base wrapped type to fix
     100        issues with multiple inheritance. The issue was that cacheWrapper()
     101        was getting called with a DOM object subtype pointer (e.g.
     102        AudioContext*) but uncacheWrapper() was getting called with a base
     103        wrapped type pointer (e.g. EventTarget*). Most of our DOM classes
     104        use multiple inheritance and thus the pointer values (used as keys
     105        in the weak map) may differ.
     106
     107        * bindings/js/JSTrackCustom.cpp:
     108        (WebCore::toJS):
     109        Call CREATE_DOM_WRAPPER() with an actual wrapped type (e.g. AudioTrack)
     110        instead of TrackBase type. TrackBase does not have corresponding
     111        generated bindings and therefore does not have a wrapperKey()
     112        function.
     113
     114        * bindings/scripts/CodeGeneratorJS.pm:
     115        (ShouldGenerateToWrapped):
     116        (ShouldGenerateToJSDeclaration):
     117        (GenerateHeader):
     118        - Generate a wrapperKey() utility function along-side wrapperOwner()
     119          to help cast to the base wrapped type.
     120        - Generate toWrapped() / toJS() utility functions for interfaces
     121          that inherit EventTarget as those are required by our
     122          implementation and this avoids having to explicitly have them in
     123          the IDL.
     124
     125        * bindings/scripts/test/*:
     126        Rebaseline bindings tests.
     127
    11282016-02-11  Brent Fulgham  <bfulgham@apple.com>
    2129
  • trunk/Source/WebCore/Modules/battery/BatteryManager.idl

    r181507 r196466  
    2424    ActiveDOMObject,
    2525    EventTarget,
    26 ] interface BatteryManager {
     26] interface BatteryManager : EventTarget {
    2727    readonly attribute boolean charging;
    2828    readonly attribute unrestricted double chargingTime;
     
    3434    attribute EventHandler ondischargingtimechange;
    3535    attribute EventHandler onlevelchange;
    36 
    37     // EventTarget interface
    38     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    39     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    40     [RaisesException] boolean dispatchEvent(Event event);
    4136};
  • trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl

    r181507 r196466  
    2929    InterfaceName=WebKitMediaKeySession,
    3030    ActiveDOMObject,
    31 ] interface MediaKeySession {
     31] interface MediaKeySession : EventTarget {
    3232    // error state
    3333    readonly attribute MediaKeyError error;
     
    4444    attribute EventHandler onwebkitkeyerror;
    4545    attribute EventHandler onwebkitkeymessage;
    46 
    47     // EventTarget interface
    48     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    49     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    50     [RaisesException] boolean dispatchEvent(Event event);
    5146};
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h

    r193428 r196466  
    4747struct ExceptionCodeWithMessage;
    4848
    49 class IDBDatabase : public RefCounted<IDBDatabase>, public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject {
     49class IDBDatabase : public RefCounted<IDBDatabase>, public EventTargetWithInlineData, public ActiveDOMObject {
    5050public:
    5151    virtual ~IDBDatabase() { }
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl

    r193428 r196466  
    2929    ActiveDOMObject,
    3030    EventTarget,
    31     JSGenerateToJSObject,
    32     JSGenerateToNativeObject,
    3331    EnabledAtRuntime=IndexedDB,
    3432    SkipVTableValidation,
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h

    r193428 r196466  
    5454};
    5555
    56 class IDBRequest : public ScriptWrappable, public EventTargetWithInlineData, public ActiveDOMObject {
     56class IDBRequest : public EventTargetWithInlineData, public ActiveDOMObject {
    5757public:
    5858    virtual ~IDBRequest() { }
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl

    r194967 r196466  
    3333    ActiveDOMObject,
    3434    EventTarget,
    35     JSGenerateToJSObject,
    36     JSGenerateToNativeObject,
    3735    SkipVTableValidation,
    3836    GenerateIsReachable=Impl,
  • trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h

    r193428 r196466  
    4949struct IDBObjectStoreMetadata;
    5050
    51 class IDBTransaction : public ScriptWrappable, public RefCounted<IDBTransaction>, public EventTargetWithInlineData, public ActiveDOMObject {
     51class IDBTransaction : public RefCounted<IDBTransaction>, public EventTargetWithInlineData, public ActiveDOMObject {
    5252public:
    5353    virtual ~IDBTransaction() { }
  • trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl

    r193428 r196466  
    2929    ActiveDOMObject,
    3030    EventTarget,
    31     JSGenerateToJSObject,
    32     JSGenerateToNativeObject,
    3331    EnabledAtRuntime=IndexedDB,
    3432    SkipVTableValidation,
  • trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.idl

    r186482 r196466  
    2929    ConstructorCallWith=ScriptExecutionContext,
    3030    EventTarget,
    31     JSGenerateToJSObject,
    3231] interface MediaRemoteControls : EventTarget {
    3332    attribute boolean previousTrackEnabled;
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.h

    r192848 r196466  
    5050class GenericEventQueue;
    5151
    52 class MediaSource : public MediaSourcePrivateClient, public ActiveDOMObject, public EventTargetWithInlineData, public ScriptWrappable, public URLRegistrable {
     52class MediaSource : public MediaSourcePrivateClient, public ActiveDOMObject, public EventTargetWithInlineData, public URLRegistrable {
    5353public:
    5454    static void setRegistry(URLRegistry*);
  • trunk/Source/WebCore/Modules/mediasource/MediaSource.idl

    r170918 r196466  
    3939    EventTarget,
    4040    EnabledBySetting=MediaSource,
    41     JSGenerateToJSObject,
    42     JSGenerateToNativeObject,
    4341    Constructor,
    4442    ConstructorCallWith=ScriptExecutionContext,
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h

    r192848 r196466  
    6060class VideoTrackList;
    6161
    62 class SourceBuffer final : public RefCounted<SourceBuffer>, public ActiveDOMObject, public EventTargetWithInlineData, public ScriptWrappable, public SourceBufferPrivateClient, public AudioTrackClient, public VideoTrackClient, public TextTrackClient {
     62class SourceBuffer final : public RefCounted<SourceBuffer>, public ActiveDOMObject, public EventTargetWithInlineData, public SourceBufferPrivateClient, public AudioTrackClient, public VideoTrackClient, public TextTrackClient {
    6363public:
    6464    static Ref<SourceBuffer> create(Ref<SourceBufferPrivate>&&, MediaSource*);
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl

    r178172 r196466  
    3939    ActiveDOMObject,
    4040    EventTarget,
    41     JSGenerateToJSObject,
    42     JSGenerateToNativeObject,
    4341] interface SourceBuffer : EventTarget {
    4442
  • trunk/Source/WebCore/Modules/mediasource/SourceBufferList.h

    r184940 r196466  
    4444class SourceBuffer;
    4545
    46 class SourceBufferList final : public RefCounted<SourceBufferList>, public ScriptWrappable, public EventTargetWithInlineData {
     46class SourceBufferList final : public RefCounted<SourceBufferList>, public EventTargetWithInlineData {
    4747public:
    4848    static Ref<SourceBufferList> create(ScriptExecutionContext* context)
  • trunk/Source/WebCore/Modules/mediasource/SourceBufferList.idl

    r159061 r196466  
    3333    NoInterfaceObject,
    3434    EventTarget,
    35     JSGenerateToJSObject,
    36     JSGenerateToNativeObject,
    3735    GenerateIsReachable=Impl,
    3836    CallWith=ScriptExecutionContext,
  • trunk/Source/WebCore/Modules/mediastream/MediaStream.h

    r194397 r196466  
    4545namespace WebCore {
    4646
    47 class MediaStream final : public URLRegistrable, public ScriptWrappable, public EventTargetWithInlineData, public ContextDestructionObserver, public MediaStreamTrack::Observer, public MediaStreamPrivate::Observer, public RefCounted<MediaStream> {
     47class MediaStream final : public URLRegistrable, public EventTargetWithInlineData, public ContextDestructionObserver, public MediaStreamTrack::Observer, public MediaStreamPrivate::Observer, public RefCounted<MediaStream> {
    4848public:
    4949    class Observer {
  • trunk/Source/WebCore/Modules/mediastream/MediaStream.idl

    r186697 r196466  
    3030    Constructor(MediaStreamTrack[] tracks),
    3131    ConstructorCallWith=ScriptExecutionContext,
    32 ] interface MediaStream {
     32] interface MediaStream : EventTarget {
    3333
    3434    readonly attribute DOMString id;
     
    5050    attribute EventHandler onaddtrack;
    5151    attribute EventHandler onremovetrack;
    52 
    53     // EventTarget interface
    54     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    55     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    56     [RaisesException] boolean dispatchEvent(Event event);
    5752};
    5853
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h

    r194371 r196466  
    4949class MediaTrackConstraints;
    5050
    51 class MediaStreamTrack final : public RefCounted<MediaStreamTrack>, public ScriptWrappable, public ActiveDOMObject, public EventTargetWithInlineData, public MediaStreamTrackPrivate::Observer {
     51class MediaStreamTrack final : public RefCounted<MediaStreamTrack>, public ActiveDOMObject, public EventTargetWithInlineData, public MediaStreamTrackPrivate::Observer {
    5252public:
    5353    class Observer {
  • trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.idl

    r193389 r196466  
    3131    ActiveDOMObject,
    3232    SkipVTableValidation,
    33 ] interface MediaStreamTrack {
     33] interface MediaStreamTrack : EventTarget {
    3434    readonly attribute DOMString kind;
    3535    readonly attribute DOMString id;
     
    5353
    5454    attribute EventHandler onoverconstrained;
    55 
    56     // EventTarget interface
    57     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    58     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    59     [RaisesException] boolean dispatchEvent(Event event);
    6055};
    6156
  • trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.h

    r192848 r196466  
    4242class RTCDTMFSenderHandler;
    4343
    44 class RTCDTMFSender final : public RefCounted<RTCDTMFSender>, public ScriptWrappable, public EventTargetWithInlineData, public RTCDTMFSenderHandlerClient, public ActiveDOMObject {
     44class RTCDTMFSender final : public RefCounted<RTCDTMFSender>, public EventTargetWithInlineData, public RTCDTMFSenderHandlerClient, public ActiveDOMObject {
    4545public:
    4646    static RefPtr<RTCDTMFSender> create(ScriptExecutionContext*, RTCPeerConnectionHandler*, PassRefPtr<MediaStreamTrack>, ExceptionCode&);
  • trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.idl

    r181507 r196466  
    2929    ActiveDOMObject,
    3030    EventTarget,
    31 ] interface RTCDTMFSender {
     31] interface RTCDTMFSender : EventTarget {
    3232    readonly attribute boolean canInsertDTMF;
    3333    readonly attribute MediaStreamTrack track;
     
    3939
    4040    attribute EventHandler ontonechange;
    41 
    42     // EventTarget interface
    43     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    44     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    45     [RaisesException] boolean dispatchEvent(Event event);
    4641};
  • trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h

    r192354 r196466  
    4646class RTCPeerConnectionHandler;
    4747
    48 class RTCDataChannel final : public RefCounted<RTCDataChannel>, public ScriptWrappable, public EventTargetWithInlineData, public RTCDataChannelHandlerClient {
     48class RTCDataChannel final : public RefCounted<RTCDataChannel>, public EventTargetWithInlineData, public RTCDataChannelHandlerClient {
    4949public:
    5050    static Ref<RTCDataChannel> create(ScriptExecutionContext*, std::unique_ptr<RTCDataChannelHandler>);
  • trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl

    r181507 r196466  
    2727    Conditional=MEDIA_STREAM,
    2828    EventTarget,
    29 ] interface RTCDataChannel {
     29] interface RTCDataChannel : EventTarget {
    3030    readonly attribute DOMString label;
    3131    readonly attribute boolean ordered;
     
    5151    attribute EventHandler onclose;
    5252    attribute EventHandler onmessage;
    53 
    54     // EventTarget interface
    55     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    56     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    57     [RaisesException] boolean dispatchEvent(Event event);
    5853};
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h

    r194968 r196466  
    6060class RTCStatsCallback;
    6161
    62 class RTCPeerConnection final : public RefCounted<RTCPeerConnection>, public ScriptWrappable, public PeerConnectionBackendClient, public RTCRtpSenderClient, public EventTargetWithInlineData, public ActiveDOMObject {
     62class RTCPeerConnection final : public RefCounted<RTCPeerConnection>, public PeerConnectionBackendClient, public RTCRtpSenderClient, public EventTargetWithInlineData, public ActiveDOMObject {
    6363public:
    6464    static RefPtr<RTCPeerConnection> create(ScriptExecutionContext&, const Dictionary& rtcConfiguration, ExceptionCode&);
  • trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl

    r192464 r196466  
    3939    EventTarget,
    4040    InterfaceName=webkitRTCPeerConnection,
    41 ] interface RTCPeerConnection {
     41] interface RTCPeerConnection : EventTarget {
    4242
    4343    // Private functions called by runQueuedOperation() (RTCPeerConnectionInternals.js)
     
    113113    attribute EventHandler onicegatheringstatechange;
    114114    attribute EventHandler ondatachannel;
    115 
    116     // EventTarget interface
    117     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    118     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    119     [RaisesException] boolean dispatchEvent(Event event);
    120115};
  • trunk/Source/WebCore/Modules/notifications/Notification.idl

    r181507 r196466  
    3838    ConstructorCallWith=Document,
    3939#endif
    40 ] interface Notification {
     40] interface Notification : EventTarget {
    4141    void show();
    4242    [Conditional=LEGACY_NOTIFICATIONS] void cancel();
     
    5555    [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString replaceId;
    5656    [Conditional=NOTIFICATIONS] attribute DOMString tag;
    57 
    58     // EventTarget interface
    59     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    60     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    61     [RaisesException] boolean dispatchEvent(Event event);
    6257};
    6358
  • trunk/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.idl

    r181507 r196466  
    2929    ConstructorCallWith=ScriptExecutionContext,
    3030    Constructor([Default=NullString] optional DOMString text)
    31 ] interface SpeechSynthesisUtterance {
     31] interface SpeechSynthesisUtterance : EventTarget
     32{
    3233    attribute DOMString text;
    3334    attribute DOMString lang;
     
    4445    attribute EventHandler onmark;
    4546    attribute EventHandler onboundary;
    46 
    47     // EventTarget interface
    48     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    49     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    50     [RaisesException] boolean dispatchEvent(Event event);
    5147};
  • trunk/Source/WebCore/Modules/webaudio/AudioContext.idl

    r185493 r196466  
    3838    EventTarget,
    3939    InterfaceName=webkitAudioContext,
    40 ] interface AudioContext {
     40] interface AudioContext : EventTarget {
    4141    // All rendered audio ultimately connects to destination, which represents the audio hardware.
    4242    readonly attribute AudioDestinationNode destination;
  • trunk/Source/WebCore/Modules/webaudio/AudioNode.idl

    r181507 r196466  
    2525[
    2626    Conditional=WEB_AUDIO,
    27     JSGenerateToJSObject,
    28     JSGenerateToNativeObject,
    2927    GenerateIsReachable=Impl,
    3028    EventTarget,
     
    4139    [RaisesException] void connect(AudioParam? destination, [Default=Undefined] optional unsigned long output);
    4240    [RaisesException] void disconnect([Default=Undefined] optional unsigned long output);
    43 
    44     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    45     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    46     [RaisesException] boolean dispatchEvent(Event event);
    4741};
  • trunk/Source/WebCore/Modules/websockets/WebSocket.idl

    r181507 r196466  
    4040    ConstructorCallWith=ScriptExecutionContext,
    4141    EventTarget,
    42 ] interface WebSocket {
     42] interface WebSocket : EventTarget {
    4343    readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
    4444    readonly attribute DOMString url;
     
    7070
    7171    [RaisesException] void close([Clamp] optional unsigned short code, optional DOMString reason);
    72 
    73     // EventTarget interface
    74     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    75     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    76     [RaisesException] boolean dispatchEvent(Event event);
    7772};
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r196350 r196466  
    24172417                5F2DBBE9178E3C8100141486 /* CertificateInfoMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */; };
    24182418                5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F2DBBE8178E336900141486 /* CertificateInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
    2419                 5FC7DC26CFE2563200B85AE4 /* JSEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */; };
     2419                5FC7DC26CFE2563200B85AE4 /* JSEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
    24202420                5FE1D292178FD1F3001AA3C3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5FE1D291178FD1F3001AA3C3 /* Security.framework */; };
    24212421                626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */; };
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r196423 r196466  
    178178}
    179179
     180inline void* wrapperKey(JSC::ArrayBuffer* domObject)
     181{
     182    return domObject;
     183}
     184
    180185inline JSDOMObject* getInlineCachedWrapper(DOMWrapperWorld&, void*) { return nullptr; }
    181186inline bool setInlineCachedWrapper(DOMWrapperWorld&, void*, JSDOMObject*, JSC::WeakHandleOwner*) { return false; }
     
    232237    if (JSC::JSObject* wrapper = getInlineCachedWrapper(world, domObject))
    233238        return wrapper;
    234     return world.m_wrappers.get(domObject);
     239    return world.m_wrappers.get(wrapperKey(domObject));
    235240}
    236241
     
    240245    if (setInlineCachedWrapper(world, domObject, wrapper, owner))
    241246        return;
    242     weakAdd(world.m_wrappers, (void*)domObject, JSC::Weak<JSC::JSObject>(wrapper, owner, &world));
     247    weakAdd(world.m_wrappers, wrapperKey(domObject), JSC::Weak<JSC::JSObject>(wrapper, owner, &world));
    243248}
    244249
     
    247252    if (clearInlineCachedWrapper(world, domObject, wrapper))
    248253        return;
    249     weakRemove(world.m_wrappers, (void*)domObject, wrapper);
     254    weakRemove(world.m_wrappers, wrapperKey(domObject), wrapper);
    250255}
    251256
  • trunk/Source/WebCore/bindings/js/JSTrackCustom.cpp

    r191887 r196466  
    5959        return jsNull();
    6060   
    61     JSObject* wrapper = getCachedWrapper(globalObject->world(), track);
    62     if (wrapper)
    63         return wrapper;
    64    
    6561    switch (track->type()) {
    6662    case TrackBase::BaseTrack:
     
    7066       
    7167    case TrackBase::AudioTrack:
     68        if (auto* wrapper = getCachedWrapper(globalObject->world(), toAudioTrack(track)))
     69            return wrapper;
    7270        return CREATE_DOM_WRAPPER(globalObject, AudioTrack, track);
    7371
    7472    case TrackBase::VideoTrack:
     73        if (auto* wrapper = getCachedWrapper(globalObject->world(), toVideoTrack(track)))
     74            return wrapper;
    7575        return CREATE_DOM_WRAPPER(globalObject, VideoTrack, track);
    7676
    7777    case TrackBase::TextTrack:
     78        if (auto* wrapper = getCachedWrapper(globalObject->world(), toTextTrack(track)))
     79            return wrapper;
    7880        return CREATE_DOM_WRAPPER(globalObject, TextTrack, track);
    7981    }
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm

    r195289 r196466  
    19221922    my ($object, $interface, $defines) = @_;
    19231923
     1924    # FIXME: GObject bindings do not support EventTarget as base class.
     1925    $interface->parent(undef) if $interface->parent && $interface->parent eq "EventTarget";
     1926
    19241927    # Set up some global variables
    19251928    $className = GetClassName($interface->name);
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r196423 r196466  
    532532
    533533    return 0 if not NeedsImplementationClass($interface);
    534     if (!$hasParent or $interface->extendedAttributes->{"JSGenerateToNativeObject"}) {
    535         return 1;
    536     }
     534    return 1 if !$hasParent or $interface->extendedAttributes->{"JSGenerateToNativeObject"};
     535    return 1 if $interface->parent && $interface->parent eq "EventTarget";
    537536    return 0;
    538537}
     
    561560    return 0 if $interface->name eq "AbstractView";
    562561    return 1 if (!$hasParent or $interface->extendedAttributes->{"JSGenerateToJSObject"} or $interface->extendedAttributes->{"CustomToJSObject"});
     562    return 1 if $interface->parent && $interface->parent eq "EventTarget";
    563563    return 0;
    564564}
     
    12421242        push(@headerContent, "    static NeverDestroyed<JS${interfaceName}Owner> owner;\n");
    12431243        push(@headerContent, "    return &owner.get();\n");
     1244        push(@headerContent, "}\n");
     1245        push(@headerContent, "\n");
     1246        push(@headerContent, "inline void* wrapperKey($implType* domObject)\n");
     1247        push(@headerContent, "{\n");
     1248        push(@headerContent, "    return domObject;\n");
    12441249        push(@headerContent, "}\n");
    12451250        push(@headerContent, "\n");
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm

    r193637 r196466  
    361361
    362362    my $name = $interface->name;
     363
     364    # ObjC bindings only support EventTarget as base class for Node.
     365    $interface->parents([grep(!/EventTarget/, @{$interface->parents})]) if $name ne "Node";
     366
    363367    my $className = GetClassName($name);
    364368    my $parentClassName = "DOM" . GetParentImplClassName($interface);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h

    r196423 r196466  
    7979}
    8080
     81inline void* wrapperKey(TestActiveDOMObject* domObject)
     82{
     83    return domObject;
     84}
     85
    8186JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestActiveDOMObject*);
    8287inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestActiveDOMObject& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h

    r196423 r196466  
    7878}
    7979
     80inline void* wrapperKey(TestClassWithJSBuiltinConstructor* domObject)
     81{
     82    return domObject;
     83}
     84
    8085JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestClassWithJSBuiltinConstructor*);
    8186inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestClassWithJSBuiltinConstructor& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h

    r196423 r196466  
    7575}
    7676
     77inline void* wrapperKey(TestCustomConstructorWithNoInterfaceObject* domObject)
     78{
     79    return domObject;
     80}
     81
    7782JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomConstructorWithNoInterfaceObject*);
    7883inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h

    r196423 r196466  
    8282}
    8383
     84inline void* wrapperKey(TestCustomNamedGetter* domObject)
     85{
     86    return domObject;
     87}
     88
    8489JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomNamedGetter*);
    8590inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCustomNamedGetter& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h

    r196423 r196466  
    7878}
    7979
     80inline void* wrapperKey(TestEventConstructor* domObject)
     81{
     82    return domObject;
     83}
     84
    8085JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventConstructor*);
    8186inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestEventConstructor& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp

    r196396 r196466  
    2222#include "JSTestEventTarget.h"
    2323
    24 #include "Event.h"
    2524#include "ExceptionCode.h"
    2625#include "JSDOMBinding.h"
    2726#include "JSDOMConstructor.h"
    28 #include "JSEvent.h"
    29 #include "JSEventListener.h"
    3027#include "JSNode.h"
    3128#include "Node.h"
    3229#include "wtf/text/AtomicString.h"
    3330#include <runtime/Error.h>
    34 #include <runtime/FunctionPrototype.h>
    3531#include <runtime/PropertyNameArray.h>
    3632#include <wtf/GetPtr.h>
     
    4339
    4440JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionItem(JSC::ExecState*);
    45 JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionAddEventListener(JSC::ExecState*);
    46 JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionRemoveEventListener(JSC::ExecState*);
    47 JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionDispatchEvent(JSC::ExecState*);
    4841
    4942// Attributes
     
    8174template<> JSValue JSTestEventTargetConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
    8275{
    83     UNUSED_PARAM(vm);
    84     return globalObject.functionPrototype();
     76    return JSEventTarget::getConstructor(vm, &globalObject);
    8577}
    8678
     
    10092    { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestEventTargetConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestEventTargetConstructor) } },
    10193    { "item", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionItem), (intptr_t) (1) } },
    102     { "addEventListener", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionAddEventListener), (intptr_t) (2) } },
    103     { "removeEventListener", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionRemoveEventListener), (intptr_t) (2) } },
    104     { "dispatchEvent", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionDispatchEvent), (intptr_t) (1) } },
    10594};
    10695
     
    116105
    117106JSTestEventTarget::JSTestEventTarget(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestEventTarget>&& impl)
    118     : JSDOMWrapper<TestEventTarget>(structure, globalObject, WTFMove(impl))
     107    : JSEventTarget(structure, globalObject, WTFMove(impl))
    119108{
    120109}
     
    122111JSObject* JSTestEventTarget::createPrototype(VM& vm, JSGlobalObject* globalObject)
    123112{
    124     return JSTestEventTargetPrototype::create(vm, globalObject, JSTestEventTargetPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
     113    return JSTestEventTargetPrototype::create(vm, globalObject, JSTestEventTargetPrototype::createStructure(vm, globalObject, JSEventTarget::getPrototype(vm, globalObject)));
    125114}
    126115
     
    128117{
    129118    return getDOMPrototype<JSTestEventTarget>(vm, globalObject);
    130 }
    131 
    132 void JSTestEventTarget::destroy(JSC::JSCell* cell)
    133 {
    134     JSTestEventTarget* thisObject = static_cast<JSTestEventTarget*>(cell);
    135     thisObject->JSTestEventTarget::~JSTestEventTarget();
    136119}
    137120
     
    230213}
    231214
    232 EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionAddEventListener(ExecState* state)
    233 {
    234     JSValue thisValue = state->thisValue();
    235     JSTestEventTarget* castedThis = jsDynamicCast<JSTestEventTarget*>(thisValue);
    236     if (UNLIKELY(!castedThis))
    237         return throwThisTypeError(*state, "TestEventTarget", "addEventListener");
    238     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestEventTarget::info());
    239     auto& impl = castedThis->wrapped();
    240     JSValue listener = state->argument(1);
    241     if (UNLIKELY(!listener.isObject()))
    242         return JSValue::encode(jsUndefined());
    243     impl.addEventListener(state->argument(0).toString(state)->toAtomicString(state), createJSEventListenerForAdd(*state, *asObject(listener), *castedThis), state->argument(2).toBoolean(state));
    244     return JSValue::encode(jsUndefined());
    245 }
    246 
    247 EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionRemoveEventListener(ExecState* state)
    248 {
    249     JSValue thisValue = state->thisValue();
    250     JSTestEventTarget* castedThis = jsDynamicCast<JSTestEventTarget*>(thisValue);
    251     if (UNLIKELY(!castedThis))
    252         return throwThisTypeError(*state, "TestEventTarget", "removeEventListener");
    253     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestEventTarget::info());
    254     auto& impl = castedThis->wrapped();
    255     JSValue listener = state->argument(1);
    256     if (UNLIKELY(!listener.isObject()))
    257         return JSValue::encode(jsUndefined());
    258     impl.removeEventListener(state->argument(0).toString(state)->toAtomicString(state), createJSEventListenerForRemove(*state, *asObject(listener), *castedThis).ptr(), state->argument(2).toBoolean(state));
    259     return JSValue::encode(jsUndefined());
    260 }
    261 
    262 EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionDispatchEvent(ExecState* state)
    263 {
    264     JSValue thisValue = state->thisValue();
    265     JSTestEventTarget* castedThis = jsDynamicCast<JSTestEventTarget*>(thisValue);
    266     if (UNLIKELY(!castedThis))
    267         return throwThisTypeError(*state, "TestEventTarget", "dispatchEvent");
    268     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestEventTarget::info());
    269     auto& impl = castedThis->wrapped();
    270     if (UNLIKELY(state->argumentCount() < 1))
    271         return throwVMError(state, createNotEnoughArgumentsError(state));
    272     ExceptionCode ec = 0;
    273     Event* evt = JSEvent::toWrapped(state->argument(0));
    274     if (UNLIKELY(state->hadException()))
    275         return JSValue::encode(jsUndefined());
    276     JSValue result = jsBoolean(impl.dispatchEvent(evt, ec));
    277 
    278     setDOMException(state, ec);
    279     return JSValue::encode(result);
    280 }
    281 
    282215void JSTestEventTarget::visitChildren(JSCell* cell, SlotVisitor& visitor)
    283216{
     
    286219    Base::visitChildren(thisObject, visitor);
    287220    thisObject->wrapped().visitJSEventListeners(visitor);
    288 }
    289 
    290 bool JSTestEventTargetOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
    291 {
    292     auto* jsTestEventTarget = jsCast<JSTestEventTarget*>(handle.slot()->asCell());
    293     if (jsTestEventTarget->wrapped().isFiringEventListeners())
    294         return true;
    295     UNUSED_PARAM(visitor);
    296     return false;
    297 }
    298 
    299 void JSTestEventTargetOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
    300 {
    301     auto* jsTestEventTarget = jsCast<JSTestEventTarget*>(handle.slot()->asCell());
    302     auto& world = *static_cast<DOMWrapperWorld*>(context);
    303     uncacheWrapper(world, &jsTestEventTarget->wrapped(), jsTestEventTarget);
    304221}
    305222
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h

    r196423 r196466  
    2222#define JSTestEventTarget_h
    2323
    24 #include "JSDOMWrapper.h"
     24#include "JSEventTarget.h"
    2525#include "TestEventTarget.h"
    26 #include <wtf/NeverDestroyed.h>
    2726
    2827namespace WebCore {
    2928
    30 class JSTestEventTarget : public JSDOMWrapper<TestEventTarget> {
     29class JSTestEventTarget : public JSEventTarget {
    3130public:
    32     typedef JSDOMWrapper<TestEventTarget> Base;
     31    typedef JSEventTarget Base;
    3332    static JSTestEventTarget* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestEventTarget>&& impl)
    3433    {
     
    4645    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
    4746    static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
    48     static void destroy(JSC::JSCell*);
    4947
    5048    DECLARE_INFO;
     
    5957    static void visitChildren(JSCell*, JSC::SlotVisitor&);
    6058
     59    TestEventTarget& wrapped() const
     60    {
     61        return static_cast<TestEventTarget&>(Base::wrapped());
     62    }
    6163public:
    6264    static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::MasqueradesAsUndefined | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
     
    7476};
    7577
    76 class JSTestEventTargetOwner : public JSC::WeakHandleOwner {
    77 public:
    78     virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
    79     virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
    80 };
    81 
    82 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestEventTarget*)
    83 {
    84     static NeverDestroyed<JSTestEventTargetOwner> owner;
    85     return &owner.get();
    86 }
    87 
    8878JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventTarget*);
    8979inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestEventTarget& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h

    r196423 r196466  
    8080}
    8181
     82inline void* wrapperKey(TestException* domObject)
     83{
     84    return domObject;
     85}
     86
    8287JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestException*);
    8388inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestException& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h

    r196423 r196466  
    7676}
    7777
     78inline void* wrapperKey(TestGenerateIsReachable* domObject)
     79{
     80    return domObject;
     81}
     82
    7883JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestGenerateIsReachable*);
    7984inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestGenerateIsReachable& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h

    r196423 r196466  
    103103}
    104104
     105inline void* wrapperKey(TestInterface* domObject)
     106{
     107    return domObject;
     108}
     109
    105110WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestInterface*);
    106111inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestInterface& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h

    r196423 r196466  
    7676}
    7777
     78inline void* wrapperKey(TestMediaQueryListListener* domObject)
     79{
     80    return domObject;
     81}
     82
    7883JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestMediaQueryListListener*);
    7984inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestMediaQueryListListener& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h

    r196423 r196466  
    7777}
    7878
     79inline void* wrapperKey(TestNamedConstructor* domObject)
     80{
     81    return domObject;
     82}
     83
    7984JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedConstructor*);
    8085inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedConstructor& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h

    r196423 r196466  
    7676}
    7777
     78inline void* wrapperKey(TestNondeterministic* domObject)
     79{
     80    return domObject;
     81}
     82
    7883JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNondeterministic*);
    7984inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNondeterministic& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h

    r196423 r196466  
    9292}
    9393
     94inline void* wrapperKey(TestObj* domObject)
     95{
     96    return domObject;
     97}
     98
    9499JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestObj*);
    95100inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestObj& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h

    r196423 r196466  
    7676}
    7777
     78inline void* wrapperKey(TestOverloadedConstructors* domObject)
     79{
     80    return domObject;
     81}
     82
    7883JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverloadedConstructors*);
    7984inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestOverloadedConstructors& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h

    r196423 r196466  
    8383}
    8484
     85inline void* wrapperKey(TestOverrideBuiltins* domObject)
     86{
     87    return domObject;
     88}
     89
    8590JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverrideBuiltins*);
    8691inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestOverrideBuiltins& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h

    r196423 r196466  
    8282}
    8383
     84inline void* wrapperKey(TestSerializedScriptValueInterface* domObject)
     85{
     86    return domObject;
     87}
     88
    8489JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface*);
    8590inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h

    r196423 r196466  
    7979}
    8080
     81inline void* wrapperKey(TestTypedefs* domObject)
     82{
     83    return domObject;
     84}
     85
    8186JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestTypedefs*);
    8287inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestTypedefs& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h

    r196423 r196466  
    7777}
    7878
     79inline void* wrapperKey(attribute* domObject)
     80{
     81    return domObject;
     82}
     83
    7984JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, attribute*);
    8085inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, attribute& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h

    r196423 r196466  
    7676}
    7777
     78inline void* wrapperKey(readonly* domObject)
     79{
     80    return domObject;
     81}
     82
    7883JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, readonly*);
    7984inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, readonly& impl) { return toJS(state, globalObject, &impl); }
  • trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.h

    r183350 r196466  
    2727#import <WebCore/DOMObject.h>
    2828
    29 @class DOMEvent;
    3029@class DOMNode;
    31 @class NSString;
    32 @protocol DOMEventListener;
    3330
    3431WEBKIT_CLASS_AVAILABLE_MAC(9876_5)
    3532WEBCORE_EXPORT @interface DOMTestEventTarget : DOMObject
    3633- (DOMNode *)item:(unsigned)index;
    37 - (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
    38 - (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
    39 - (BOOL)dispatchEvent:(DOMEvent *)evt;
    4034@end
  • trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.mm

    r193378 r196466  
    3333#import "DOMNodeInternal.h"
    3434#import "DOMTestEventTargetInternal.h"
    35 #import "Event.h"
    36 #import "EventListener.h"
    3735#import "ExceptionHandlers.h"
    3836#import "JSMainThreadExecState.h"
    3937#import "Node.h"
    40 #import "ObjCEventListener.h"
    4138#import "TestEventTarget.h"
    4239#import "ThreadCheck.h"
    43 #import "URL.h"
    4440#import "WebCoreObjCExtras.h"
    4541#import "WebScriptObjectPrivate.h"
     
    6662}
    6763
    68 - (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
    69 {
    70     WebCore::JSMainThreadNullState state;
    71     RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
    72     IMPL->addEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
    73 }
    74 
    75 - (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
    76 {
    77     WebCore::JSMainThreadNullState state;
    78     RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
    79     IMPL->removeEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
    80 }
    81 
    82 - (BOOL)dispatchEvent:(DOMEvent *)evt
    83 {
    84     WebCore::JSMainThreadNullState state;
    85     WebCore::ExceptionCode ec = 0;
    86     BOOL result = IMPL->dispatchEvent(core(evt), ec);
    87     WebCore::raiseOnDOMError(ec);
    88     return result;
    89 }
    90 
    9164@end
    9265
  • trunk/Source/WebCore/bindings/scripts/test/TestEventTarget.idl

    r189770 r196466  
    3030    EventTarget,
    3131    MasqueradesAsUndefined
    32 ] interface TestEventTarget {
     32] interface TestEventTarget : EventTarget {
    3333
    3434    getter Node item(unsigned long index);
    3535    getter Node (DOMString name);
    36 
    37     void addEventListener(DOMString type,
    38                           EventListener listener,
    39                           optional boolean useCapture);
    40     void removeEventListener(DOMString type,
    41                              EventListener listener,
    42                              optional boolean useCapture);
    43     [RaisesException] boolean dispatchEvent(Event evt);
    4436};
    4537
  • trunk/Source/WebCore/css/FontLoader.idl

    r181507 r196466  
    3535    EventTarget,
    3636    GenerateIsReachable=ImplDocument,
    37 ] interface FontLoader {
     37] interface FontLoader : EventTarget {
    3838
    3939    attribute EventHandler onloading;
     
    4747    void notifyWhenFontsReady(VoidCallback callback);
    4848    readonly attribute boolean loading;
    49 
    50     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    51     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    52     [RaisesException] boolean dispatchEvent(Event event);
    5349};
  • trunk/Source/WebCore/dom/EventTarget.h

    r192354 r196466  
    3535#include "EventNames.h"
    3636#include "EventTargetInterfaces.h"
     37#include "ScriptWrappable.h"
    3738#include <memory>
    3839#include <wtf/Forward.h>
     
    109110};
    110111
    111 class EventTarget {
     112class EventTarget : public ScriptWrappable {
    112113public:
    113114    void ref() { refEventTarget(); }
  • trunk/Source/WebCore/dom/MessagePort.idl

    r181507 r196466  
    3131    ActiveDOMObject,
    3232    EventTarget,
    33 ] interface MessagePort {
     33] interface MessagePort : EventTarget {
    3434// We need to have something as an ObjC binding, because MessagePort is used in MessageEvent, which already has one,
    3535// but we don't want to actually expose the API while it is in flux.
     
    4141
    4242    attribute EventHandler onmessage;
    43 
    44     // EventTarget interface
    45     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    46     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    47     [RaisesException] boolean dispatchEvent(Event event);
    4843#endif
    4944};
  • trunk/Source/WebCore/dom/Node.h

    r196123 r196466  
    3131#include "MutationObserver.h"
    3232#include "RenderStyleConstants.h"
    33 #include "ScriptWrappable.h"
    3433#include "TreeScope.h"
    3534#include <wtf/Forward.h>
     
    114113};
    115114
    116 class Node : public EventTarget, public ScriptWrappable {
     115class Node : public EventTarget {
    117116    WTF_MAKE_FAST_ALLOCATED;
    118117
  • trunk/Source/WebCore/dom/Node.idl

    r195682 r196466  
    2626    CustomToJSObject,
    2727    EventTarget,
    28     JSGenerateToNativeObject,
    2928    ObjCPolymorphic,
    3029] interface Node
    3130#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
    3231    : Object, EventTarget
    33 #endif /* defined(LANGUAGE_OBJECTIVE_C) */
     32#else
     33    : EventTarget
     34#endif
    3435 {
    3536    // NodeType
     
    126127    void inspect();
    127128#endif
    128 
    129 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
    130     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    131     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    132     [RaisesException] boolean dispatchEvent(Event event);
    133 #endif
    134 
    135129};
    136130
  • trunk/Source/WebCore/dom/WebKitNamedFlow.idl

    r181507 r196466  
    3131    NoInterfaceObject,
    3232    EventTarget,
    33     JSGenerateToJSObject,
    3433    GenerateIsReachable=ImplOwnerNodeRoot,
    35 ] interface WebKitNamedFlow {
     34] interface WebKitNamedFlow
     35#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
     36: EventTarget
     37#endif
     38{
    3639    readonly attribute DOMString name;
    3740    readonly attribute boolean overset;
     
    4043    NodeList getRegions();
    4144    NodeList getContent();
    42    
    43     // EventTarget interface
    44     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    45     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    46     [RaisesException] boolean dispatchEvent(Event event);
    4745};
  • trunk/Source/WebCore/fileapi/FileReader.idl

    r181507 r196466  
    3636    ConstructorCallWith=ScriptExecutionContext,
    3737    EventTarget,
    38 ] interface FileReader {
     38] interface FileReader : EventTarget {
    3939    // ready states
    4040    const unsigned short EMPTY = 0;
     
    5656    readonly attribute FileError error;
    5757
    58     // EventTarget interface
    59     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    60     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    61     [RaisesException] boolean dispatchEvent(Event event);
    62 
    6358    attribute EventHandler onloadstart;
    6459    attribute EventHandler onprogress;
  • trunk/Source/WebCore/html/MediaController.idl

    r181507 r196466  
    2828    Constructor,
    2929    ConstructorCallWith=ScriptExecutionContext,
    30     JSGenerateToJSObject,
    3130    EventTarget,
    32 ] interface MediaController {
     31] interface MediaController : EventTarget {
    3332    readonly attribute TimeRanges buffered;
    3433    readonly attribute TimeRanges seekable;
     
    4948    [SetterRaisesException] attribute unrestricted double volume;
    5049    attribute boolean muted;
    51 
    52     // EventTarget interface
    53     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    54     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    55     [RaisesException] boolean dispatchEvent(Event event);
    5650};
  • trunk/Source/WebCore/html/track/AudioTrackList.idl

    r181507 r196466  
    3030    EventTarget,
    3131    JSCustomMarkFunction,
    32 ] interface AudioTrackList {
     32] interface AudioTrackList : EventTarget {
    3333    readonly attribute unsigned long length;
    3434    getter AudioTrack item(unsigned long index);
     
    3838    attribute EventHandler onaddtrack;
    3939    attribute EventHandler onremovetrack;
    40 
    41     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    42     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    43     [RaisesException] boolean dispatchEvent(Event event);
    4440};
    4541
  • trunk/Source/WebCore/html/track/TextTrack.idl

    r188660 r196466  
    3333    JSCustomMarkFunction,
    3434    SkipVTableValidation,
    35 ] interface TextTrack {
     35] interface TextTrack : EventTarget {
    3636    readonly attribute DOMString id;
    3737    [CustomSetter] attribute TextTrackKind kind;
     
    5555    [RaisesException] void removeRegion(VTTRegion region);
    5656#endif
    57 
    58     // EventTarget interface
    59     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    60     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    61     [RaisesException] boolean dispatchEvent(Event event);
    6257};
  • trunk/Source/WebCore/html/track/TextTrackCue.idl

    r181507 r196466  
    2626[
    2727    Conditional=VIDEO_TRACK,
    28     JSGenerateToNativeObject,
    2928    Constructor(unrestricted double startTime, unrestricted double endTime, DOMString text),
    3029    ConstructorCallWith=ScriptExecutionContext,
     
    3433    CustomToJSObject,
    3534    SkipVTableValidation,
    36 ] interface TextTrackCue {
     35] interface TextTrackCue : EventTarget {
    3736    readonly attribute TextTrack track;
    3837
     
    4443    attribute EventHandler onenter;
    4544    attribute EventHandler onexit;
    46 
    47     // EventTarget interface
    48     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    49     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    50     [RaisesException] boolean dispatchEvent(Event event);
    5145};
    5246
  • trunk/Source/WebCore/html/track/TextTrackList.idl

    r181507 r196466  
    2929    EventTarget,
    3030    JSCustomMarkFunction,
    31 ] interface TextTrackList {
     31] interface TextTrackList : EventTarget {
    3232    readonly attribute unsigned long length;
    3333    getter TextTrack item(unsigned long index);
     
    3737    attribute EventHandler onchange;
    3838    attribute EventHandler onremovetrack;
    39 
    40     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    41     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    42     [RaisesException] boolean dispatchEvent(Event event);
    4339};
    4440
  • trunk/Source/WebCore/html/track/VideoTrackList.idl

    r181507 r196466  
    3030    EventTarget,
    3131    JSCustomMarkFunction,
    32 ] interface VideoTrackList {
     32] interface VideoTrackList : EventTarget {
    3333    readonly attribute unsigned long length;
    3434    getter VideoTrack item(unsigned long index);
     
    3939    attribute EventHandler onaddtrack;
    4040    attribute EventHandler onremovetrack;
    41 
    42     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    43     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    44     [RaisesException] boolean dispatchEvent(Event event);
    4541};
    4642
  • trunk/Source/WebCore/loader/appcache/DOMApplicationCache.h

    r192848 r196466  
    4242class URL;
    4343
    44 class DOMApplicationCache final : public ScriptWrappable, public RefCounted<DOMApplicationCache>, public EventTargetWithInlineData, public DOMWindowProperty {
     44class DOMApplicationCache final : public RefCounted<DOMApplicationCache>, public EventTargetWithInlineData, public DOMWindowProperty {
    4545public:
    4646    static Ref<DOMApplicationCache> create(Frame* frame) { return adoptRef(*new DOMApplicationCache(frame)); }
  • trunk/Source/WebCore/loader/appcache/DOMApplicationCache.idl

    r195729 r196466  
    2929    GenerateIsReachable=ImplFrame,
    3030    InterfaceName=ApplicationCache,
    31 ] interface DOMApplicationCache {
     31] interface DOMApplicationCache : EventTarget {
    3232    // update status
    3333    const unsigned short UNCACHED = 0;
     
    5151    attribute EventHandler oncached;
    5252    attribute EventHandler onobsolete;
    53 
    54     // EventTarget interface
    55     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    56     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    57     [RaisesException] boolean dispatchEvent(Event event);
    5853};
    5954
  • trunk/Source/WebCore/page/EventSource.idl

    r181507 r196466  
    3737    ConstructorRaisesException,
    3838    EventTarget,
    39 ] interface EventSource {
     39] interface EventSource : EventTarget {
    4040
    4141    readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
     
    5454    attribute EventHandler onerror;
    5555    void close();
    56 
    57     // EventTarget interface
    58     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    59     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    60     [RaisesException] boolean dispatchEvent(Event event);
    61 
    6256};
  • trunk/Source/WebCore/page/Performance.h

    r192582 r196466  
    5353class UserTiming;
    5454
    55 class Performance final : public ScriptWrappable, public RefCounted<Performance>, public DOMWindowProperty, public EventTargetWithInlineData {
     55class Performance final : public RefCounted<Performance>, public DOMWindowProperty, public EventTargetWithInlineData {
    5656public:
    5757    static Ref<Performance> create(Frame& frame) { return adoptRef(*new Performance(frame)); }
  • trunk/Source/WebCore/page/Performance.idl

    r181507 r196466  
    3434    Conditional=WEB_TIMING,
    3535    EventTarget,
    36 ] interface Performance {
     36] interface Performance : EventTarget {
    3737    readonly attribute PerformanceNavigation navigation;
    3838    readonly attribute PerformanceTiming timing;
  • trunk/Source/WebCore/workers/Worker.idl

    r181507 r196466  
    2828[
    2929    CustomConstructor(DOMString scriptUrl),
    30     JSGenerateToNativeObject,
    31     JSGenerateToJSObject,
    3230    ActiveDOMObject,
    3331] interface Worker : EventTarget {
  • trunk/Source/WebCore/xml/XMLHttpRequest.h

    r192848 r196466  
    5050class ThreadableLoader;
    5151
    52 class XMLHttpRequest final : public ScriptWrappable, public RefCounted<XMLHttpRequest>, public EventTargetWithInlineData, private ThreadableLoaderClient, public ActiveDOMObject {
     52class XMLHttpRequest final : public RefCounted<XMLHttpRequest>, public EventTargetWithInlineData, private ThreadableLoaderClient, public ActiveDOMObject {
    5353    WTF_MAKE_FAST_ALLOCATED;
    5454public:
  • trunk/Source/WebCore/xml/XMLHttpRequest.idl

    r190025 r196466  
    4343    JSCustomMarkFunction,
    4444    EventTarget,
    45 ] interface XMLHttpRequest {
     45] interface XMLHttpRequest : EventTarget {
    4646    // From XMLHttpRequestEventTarget
    4747    attribute EventHandler onabort;
     
    9292    // Extension
    9393    [RaisesException] void overrideMimeType(DOMString override);
    94 
    95     // EventTarget interface
    96     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    97     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    98     [RaisesException] boolean dispatchEvent(Event event);
    9994};
  • trunk/Source/WebCore/xml/XMLHttpRequestUpload.idl

    r192256 r196466  
    3030    GenerateIsReachable=Impl,
    3131    EventTarget,
    32 ] interface XMLHttpRequestUpload {
     32] interface XMLHttpRequestUpload : EventTarget {
    3333    // From XMLHttpRequestEventTarget
    3434    attribute EventHandler onabort;
     
    3939    attribute EventHandler onprogress;
    4040    attribute EventHandler ontimeout;
    41 
    42     // EventTarget interface
    43     void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    44     void removeEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    45     [RaisesException] boolean dispatchEvent(Event event);
    4641};
    4742
Note: See TracChangeset for help on using the changeset viewer.