Changeset 196466 in webkit
- Timestamp:
- Feb 11, 2016 11:28:32 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 88 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196439 r196466 1 2016-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 1 15 2016-02-11 Zalan Bujtas <zalan@apple.com> 2 16 -
trunk/LayoutTests/fast/dom/Window/window-properties-performance-expected.txt
r151199 r196466 2 2 3 3 window.performance [object Performance] 4 window.performance.addEventListener [function] 5 window.performance.dispatchEvent [function] 4 6 window.performance.navigation [object PerformanceNavigation] 5 7 window.performance.navigation.TYPE_BACK_FORWARD [number] … … 10 12 window.performance.navigation.type [number] 11 13 window.performance.now [function] 14 window.performance.removeEventListener [function] 12 15 window.performance.timing [object PerformanceTiming] 13 16 window.performance.timing.connectEnd [number] -
trunk/LayoutTests/fast/dom/prototype-chain-expected.txt
r40672 r196466 3 3 NOTE: 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. 4 4 5 ----- [object HTMLDocument] ( 4prototypes) -----5 ----- [object HTMLDocument] (5 prototypes) ----- 6 6 7 7 [object Object] 8 9 [object EventTargetPrototype] 8 10 9 11 [object NodePrototype] … … 13 15 [object HTMLDocumentPrototype] 14 16 15 ----- [object HTMLDivElement] ( 5prototypes) -----17 ----- [object HTMLDivElement] (6 prototypes) ----- 16 18 17 19 [object Object] 20 21 [object EventTargetPrototype] 18 22 19 23 [object NodePrototype] … … 25 29 [object HTMLDivElementPrototype] 26 30 27 ----- [object HTMLFormElement] ( 5prototypes) -----31 ----- [object HTMLFormElement] (6 prototypes) ----- 28 32 29 33 [object Object] 34 35 [object EventTargetPrototype] 30 36 31 37 [object NodePrototype] -
trunk/LayoutTests/imported/w3c/ChangeLog
r196423 r196466 1 2016-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 1 14 2016-02-11 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/interfaces-expected.txt
r196423 r196466 171 171 PASS MutationRecord interface: attribute attributeNamespace 172 172 PASS 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 }" 173 PASS Node interface: existence and properties of interface object 178 174 PASS Node interface object length 179 175 PASS 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]" 176 PASS Node interface: existence and properties of interface prototype object 181 177 PASS Node interface: existence and properties of interface prototype object's "constructor" property 182 178 PASS Node interface: constant ELEMENT_NODE on interface object -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
r196423 r196466 2234 2234 FAIL VideoTrack interface: attribute language assert_own_property: self does not have own property "VideoTrack" expected property "VideoTrack" missing 2235 2235 FAIL 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 }" 2236 PASS MediaController interface: existence and properties of interface object 2241 2237 PASS MediaController interface object length 2242 2238 PASS 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]" 2239 PASS MediaController interface: existence and properties of interface prototype object 2244 2240 PASS MediaController interface: existence and properties of interface prototype object's "constructor" property 2245 2241 FAIL MediaController interface: attribute readyState assert_true: The prototype object must have a property "readyState" expected true got false … … 2313 2309 PASS EventTarget interface: new MediaController() must inherit property "dispatchEvent" with the proper type (2) 2314 2310 PASS 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 }" 2311 PASS TextTrackList interface: existence and properties of interface object 2320 2312 PASS TextTrackList interface object length 2321 2313 PASS 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]" 2314 PASS TextTrackList interface: existence and properties of interface prototype object 2323 2315 PASS TextTrackList interface: existence and properties of interface prototype object's "constructor" property 2324 2316 PASS TextTrackList interface: attribute length … … 2345 2337 PASS EventTarget interface: document.createElement("video").textTracks must inherit property "dispatchEvent" with the proper type (2) 2346 2338 PASS 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 }" 2339 PASS TextTrack interface: existence and properties of interface object 2352 2340 PASS TextTrack interface object length 2353 2341 PASS 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]" 2342 PASS TextTrack interface: existence and properties of interface prototype object 2355 2343 PASS TextTrack interface: existence and properties of interface prototype object's "constructor" property 2356 2344 FAIL TextTrack interface: attribute kind assert_equals: setter must be undefined for readonly attributes expected (undefined) undefined but got (function) function "function kind() { … … 2406 2394 PASS TextTrackCueList interface: document.createElement("video").addTextTrack("subtitles").cues must inherit property "getCueById" with the proper type (2) 2407 2395 PASS 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 }" 2396 PASS TextTrackCue interface: existence and properties of interface object 2413 2397 FAIL TextTrackCue interface object length assert_equals: wrong value for TextTrackCue.length expected 0 but got 3 2414 2398 PASS 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]" 2399 PASS TextTrackCue interface: existence and properties of interface prototype object 2416 2400 PASS TextTrackCue interface: existence and properties of interface prototype object's "constructor" property 2417 2401 PASS TextTrackCue interface: attribute track … … 4209 4193 PASS BeforeUnloadEvent interface: existence and properties of interface prototype object's "constructor" property 4210 4194 PASS 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 }" 4195 PASS ApplicationCache interface: existence and properties of interface object 4216 4196 PASS ApplicationCache interface object length 4217 4197 PASS 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]" 4198 PASS ApplicationCache interface: existence and properties of interface prototype object 4219 4199 PASS ApplicationCache interface: existence and properties of interface prototype object's "constructor" property 4220 4200 PASS ApplicationCache interface: constant UNCACHED on interface object … … 4407 4387 PASS MessageEvent interface: attribute ports 4408 4388 FAIL 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 }" 4389 PASS EventSource interface: existence and properties of interface object 4414 4390 PASS EventSource interface object length 4415 4391 PASS 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]" 4392 PASS EventSource interface: existence and properties of interface prototype object 4417 4393 PASS EventSource interface: existence and properties of interface prototype object's "constructor" property 4418 4394 PASS EventSource interface: attribute url … … 4429 4405 PASS EventSource interface: attribute onerror 4430 4406 PASS 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 }" 4407 PASS WebSocket interface: existence and properties of interface object 4436 4408 PASS WebSocket interface object length 4437 4409 PASS 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]" 4410 PASS WebSocket interface: existence and properties of interface prototype object 4439 4411 PASS WebSocket interface: existence and properties of interface prototype object's "constructor" property 4440 4412 PASS WebSocket interface: attribute url … … 4537 4509 PASS MessageChannel interface: attribute port1 4538 4510 PASS 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 }" 4511 PASS MessagePort interface: existence and properties of interface object 4544 4512 PASS MessagePort interface object length 4545 4513 PASS 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]" 4514 PASS MessagePort interface: existence and properties of interface prototype object 4547 4515 PASS MessagePort interface: existence and properties of interface prototype object's "constructor" property 4548 4516 PASS MessagePort interface: operation postMessage(any,[object Object]) -
trunk/Source/WebCore/ChangeLog
r196460 r196466 1 2016-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 1 128 2016-02-11 Brent Fulgham <bfulgham@apple.com> 2 129 -
trunk/Source/WebCore/Modules/battery/BatteryManager.idl
r181507 r196466 24 24 ActiveDOMObject, 25 25 EventTarget, 26 ] interface BatteryManager {26 ] interface BatteryManager : EventTarget { 27 27 readonly attribute boolean charging; 28 28 readonly attribute unrestricted double chargingTime; … … 34 34 attribute EventHandler ondischargingtimechange; 35 35 attribute EventHandler onlevelchange; 36 37 // EventTarget interface38 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);41 36 }; -
trunk/Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl
r181507 r196466 29 29 InterfaceName=WebKitMediaKeySession, 30 30 ActiveDOMObject, 31 ] interface MediaKeySession {31 ] interface MediaKeySession : EventTarget { 32 32 // error state 33 33 readonly attribute MediaKeyError error; … … 44 44 attribute EventHandler onwebkitkeyerror; 45 45 attribute EventHandler onwebkitkeymessage; 46 47 // EventTarget interface48 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);51 46 }; -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h
r193428 r196466 47 47 struct ExceptionCodeWithMessage; 48 48 49 class IDBDatabase : public RefCounted<IDBDatabase>, public ScriptWrappable, publicEventTargetWithInlineData, public ActiveDOMObject {49 class IDBDatabase : public RefCounted<IDBDatabase>, public EventTargetWithInlineData, public ActiveDOMObject { 50 50 public: 51 51 virtual ~IDBDatabase() { } -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl
r193428 r196466 29 29 ActiveDOMObject, 30 30 EventTarget, 31 JSGenerateToJSObject,32 JSGenerateToNativeObject,33 31 EnabledAtRuntime=IndexedDB, 34 32 SkipVTableValidation, -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h
r193428 r196466 54 54 }; 55 55 56 class IDBRequest : public ScriptWrappable, publicEventTargetWithInlineData, public ActiveDOMObject {56 class IDBRequest : public EventTargetWithInlineData, public ActiveDOMObject { 57 57 public: 58 58 virtual ~IDBRequest() { } -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl
r194967 r196466 33 33 ActiveDOMObject, 34 34 EventTarget, 35 JSGenerateToJSObject,36 JSGenerateToNativeObject,37 35 SkipVTableValidation, 38 36 GenerateIsReachable=Impl, -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h
r193428 r196466 49 49 struct IDBObjectStoreMetadata; 50 50 51 class IDBTransaction : public ScriptWrappable, publicRefCounted<IDBTransaction>, public EventTargetWithInlineData, public ActiveDOMObject {51 class IDBTransaction : public RefCounted<IDBTransaction>, public EventTargetWithInlineData, public ActiveDOMObject { 52 52 public: 53 53 virtual ~IDBTransaction() { } -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl
r193428 r196466 29 29 ActiveDOMObject, 30 30 EventTarget, 31 JSGenerateToJSObject,32 JSGenerateToNativeObject,33 31 EnabledAtRuntime=IndexedDB, 34 32 SkipVTableValidation, -
trunk/Source/WebCore/Modules/mediasession/MediaRemoteControls.idl
r186482 r196466 29 29 ConstructorCallWith=ScriptExecutionContext, 30 30 EventTarget, 31 JSGenerateToJSObject,32 31 ] interface MediaRemoteControls : EventTarget { 33 32 attribute boolean previousTrackEnabled; -
trunk/Source/WebCore/Modules/mediasource/MediaSource.h
r192848 r196466 50 50 class GenericEventQueue; 51 51 52 class MediaSource : public MediaSourcePrivateClient, public ActiveDOMObject, public EventTargetWithInlineData, public ScriptWrappable, publicURLRegistrable {52 class MediaSource : public MediaSourcePrivateClient, public ActiveDOMObject, public EventTargetWithInlineData, public URLRegistrable { 53 53 public: 54 54 static void setRegistry(URLRegistry*); -
trunk/Source/WebCore/Modules/mediasource/MediaSource.idl
r170918 r196466 39 39 EventTarget, 40 40 EnabledBySetting=MediaSource, 41 JSGenerateToJSObject,42 JSGenerateToNativeObject,43 41 Constructor, 44 42 ConstructorCallWith=ScriptExecutionContext, -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h
r192848 r196466 60 60 class VideoTrackList; 61 61 62 class SourceBuffer final : public RefCounted<SourceBuffer>, public ActiveDOMObject, public EventTargetWithInlineData, public S criptWrappable, public SourceBufferPrivateClient, public AudioTrackClient, public VideoTrackClient, public TextTrackClient {62 class SourceBuffer final : public RefCounted<SourceBuffer>, public ActiveDOMObject, public EventTargetWithInlineData, public SourceBufferPrivateClient, public AudioTrackClient, public VideoTrackClient, public TextTrackClient { 63 63 public: 64 64 static Ref<SourceBuffer> create(Ref<SourceBufferPrivate>&&, MediaSource*); -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.idl
r178172 r196466 39 39 ActiveDOMObject, 40 40 EventTarget, 41 JSGenerateToJSObject,42 JSGenerateToNativeObject,43 41 ] interface SourceBuffer : EventTarget { 44 42 -
trunk/Source/WebCore/Modules/mediasource/SourceBufferList.h
r184940 r196466 44 44 class SourceBuffer; 45 45 46 class SourceBufferList final : public RefCounted<SourceBufferList>, public ScriptWrappable, publicEventTargetWithInlineData {46 class SourceBufferList final : public RefCounted<SourceBufferList>, public EventTargetWithInlineData { 47 47 public: 48 48 static Ref<SourceBufferList> create(ScriptExecutionContext* context) -
trunk/Source/WebCore/Modules/mediasource/SourceBufferList.idl
r159061 r196466 33 33 NoInterfaceObject, 34 34 EventTarget, 35 JSGenerateToJSObject,36 JSGenerateToNativeObject,37 35 GenerateIsReachable=Impl, 38 36 CallWith=ScriptExecutionContext, -
trunk/Source/WebCore/Modules/mediastream/MediaStream.h
r194397 r196466 45 45 namespace WebCore { 46 46 47 class MediaStream final : public URLRegistrable, public ScriptWrappable, publicEventTargetWithInlineData, public ContextDestructionObserver, public MediaStreamTrack::Observer, public MediaStreamPrivate::Observer, public RefCounted<MediaStream> {47 class MediaStream final : public URLRegistrable, public EventTargetWithInlineData, public ContextDestructionObserver, public MediaStreamTrack::Observer, public MediaStreamPrivate::Observer, public RefCounted<MediaStream> { 48 48 public: 49 49 class Observer { -
trunk/Source/WebCore/Modules/mediastream/MediaStream.idl
r186697 r196466 30 30 Constructor(MediaStreamTrack[] tracks), 31 31 ConstructorCallWith=ScriptExecutionContext, 32 ] interface MediaStream {32 ] interface MediaStream : EventTarget { 33 33 34 34 readonly attribute DOMString id; … … 50 50 attribute EventHandler onaddtrack; 51 51 attribute EventHandler onremovetrack; 52 53 // EventTarget interface54 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);57 52 }; 58 53 -
trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h
r194371 r196466 49 49 class MediaTrackConstraints; 50 50 51 class MediaStreamTrack final : public RefCounted<MediaStreamTrack>, public ScriptWrappable, publicActiveDOMObject, public EventTargetWithInlineData, public MediaStreamTrackPrivate::Observer {51 class MediaStreamTrack final : public RefCounted<MediaStreamTrack>, public ActiveDOMObject, public EventTargetWithInlineData, public MediaStreamTrackPrivate::Observer { 52 52 public: 53 53 class Observer { -
trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.idl
r193389 r196466 31 31 ActiveDOMObject, 32 32 SkipVTableValidation, 33 ] interface MediaStreamTrack {33 ] interface MediaStreamTrack : EventTarget { 34 34 readonly attribute DOMString kind; 35 35 readonly attribute DOMString id; … … 53 53 54 54 attribute EventHandler onoverconstrained; 55 56 // EventTarget interface57 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);60 55 }; 61 56 -
trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.h
r192848 r196466 42 42 class RTCDTMFSenderHandler; 43 43 44 class RTCDTMFSender final : public RefCounted<RTCDTMFSender>, public ScriptWrappable, publicEventTargetWithInlineData, public RTCDTMFSenderHandlerClient, public ActiveDOMObject {44 class RTCDTMFSender final : public RefCounted<RTCDTMFSender>, public EventTargetWithInlineData, public RTCDTMFSenderHandlerClient, public ActiveDOMObject { 45 45 public: 46 46 static RefPtr<RTCDTMFSender> create(ScriptExecutionContext*, RTCPeerConnectionHandler*, PassRefPtr<MediaStreamTrack>, ExceptionCode&); -
trunk/Source/WebCore/Modules/mediastream/RTCDTMFSender.idl
r181507 r196466 29 29 ActiveDOMObject, 30 30 EventTarget, 31 ] interface RTCDTMFSender {31 ] interface RTCDTMFSender : EventTarget { 32 32 readonly attribute boolean canInsertDTMF; 33 33 readonly attribute MediaStreamTrack track; … … 39 39 40 40 attribute EventHandler ontonechange; 41 42 // EventTarget interface43 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);46 41 }; -
trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h
r192354 r196466 46 46 class RTCPeerConnectionHandler; 47 47 48 class RTCDataChannel final : public RefCounted<RTCDataChannel>, public ScriptWrappable, publicEventTargetWithInlineData, public RTCDataChannelHandlerClient {48 class RTCDataChannel final : public RefCounted<RTCDataChannel>, public EventTargetWithInlineData, public RTCDataChannelHandlerClient { 49 49 public: 50 50 static Ref<RTCDataChannel> create(ScriptExecutionContext*, std::unique_ptr<RTCDataChannelHandler>); -
trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl
r181507 r196466 27 27 Conditional=MEDIA_STREAM, 28 28 EventTarget, 29 ] interface RTCDataChannel {29 ] interface RTCDataChannel : EventTarget { 30 30 readonly attribute DOMString label; 31 31 readonly attribute boolean ordered; … … 51 51 attribute EventHandler onclose; 52 52 attribute EventHandler onmessage; 53 54 // EventTarget interface55 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);58 53 }; -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h
r194968 r196466 60 60 class RTCStatsCallback; 61 61 62 class RTCPeerConnection final : public RefCounted<RTCPeerConnection>, public ScriptWrappable, publicPeerConnectionBackendClient, public RTCRtpSenderClient, public EventTargetWithInlineData, public ActiveDOMObject {62 class RTCPeerConnection final : public RefCounted<RTCPeerConnection>, public PeerConnectionBackendClient, public RTCRtpSenderClient, public EventTargetWithInlineData, public ActiveDOMObject { 63 63 public: 64 64 static RefPtr<RTCPeerConnection> create(ScriptExecutionContext&, const Dictionary& rtcConfiguration, ExceptionCode&); -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
r192464 r196466 39 39 EventTarget, 40 40 InterfaceName=webkitRTCPeerConnection, 41 ] interface RTCPeerConnection {41 ] interface RTCPeerConnection : EventTarget { 42 42 43 43 // Private functions called by runQueuedOperation() (RTCPeerConnectionInternals.js) … … 113 113 attribute EventHandler onicegatheringstatechange; 114 114 attribute EventHandler ondatachannel; 115 116 // EventTarget interface117 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);120 115 }; -
trunk/Source/WebCore/Modules/notifications/Notification.idl
r181507 r196466 38 38 ConstructorCallWith=Document, 39 39 #endif 40 ] interface Notification {40 ] interface Notification : EventTarget { 41 41 void show(); 42 42 [Conditional=LEGACY_NOTIFICATIONS] void cancel(); … … 55 55 [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString replaceId; 56 56 [Conditional=NOTIFICATIONS] attribute DOMString tag; 57 58 // EventTarget interface59 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 57 }; 63 58 -
trunk/Source/WebCore/Modules/speech/SpeechSynthesisUtterance.idl
r181507 r196466 29 29 ConstructorCallWith=ScriptExecutionContext, 30 30 Constructor([Default=NullString] optional DOMString text) 31 ] interface SpeechSynthesisUtterance { 31 ] interface SpeechSynthesisUtterance : EventTarget 32 { 32 33 attribute DOMString text; 33 34 attribute DOMString lang; … … 44 45 attribute EventHandler onmark; 45 46 attribute EventHandler onboundary; 46 47 // EventTarget interface48 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);51 47 }; -
trunk/Source/WebCore/Modules/webaudio/AudioContext.idl
r185493 r196466 38 38 EventTarget, 39 39 InterfaceName=webkitAudioContext, 40 ] interface AudioContext {40 ] interface AudioContext : EventTarget { 41 41 // All rendered audio ultimately connects to destination, which represents the audio hardware. 42 42 readonly attribute AudioDestinationNode destination; -
trunk/Source/WebCore/Modules/webaudio/AudioNode.idl
r181507 r196466 25 25 [ 26 26 Conditional=WEB_AUDIO, 27 JSGenerateToJSObject,28 JSGenerateToNativeObject,29 27 GenerateIsReachable=Impl, 30 28 EventTarget, … … 41 39 [RaisesException] void connect(AudioParam? destination, [Default=Undefined] optional unsigned long output); 42 40 [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);47 41 }; -
trunk/Source/WebCore/Modules/websockets/WebSocket.idl
r181507 r196466 40 40 ConstructorCallWith=ScriptExecutionContext, 41 41 EventTarget, 42 ] interface WebSocket {42 ] interface WebSocket : EventTarget { 43 43 readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons. 44 44 readonly attribute DOMString url; … … 70 70 71 71 [RaisesException] void close([Clamp] optional unsigned short code, optional DOMString reason); 72 73 // EventTarget interface74 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);77 72 }; -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r196350 r196466 2417 2417 5F2DBBE9178E3C8100141486 /* CertificateInfoMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */; }; 2418 2418 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, ); }; }; 2420 2420 5FE1D292178FD1F3001AA3C3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5FE1D291178FD1F3001AA3C3 /* Security.framework */; }; 2421 2421 626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */; }; -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r196423 r196466 178 178 } 179 179 180 inline void* wrapperKey(JSC::ArrayBuffer* domObject) 181 { 182 return domObject; 183 } 184 180 185 inline JSDOMObject* getInlineCachedWrapper(DOMWrapperWorld&, void*) { return nullptr; } 181 186 inline bool setInlineCachedWrapper(DOMWrapperWorld&, void*, JSDOMObject*, JSC::WeakHandleOwner*) { return false; } … … 232 237 if (JSC::JSObject* wrapper = getInlineCachedWrapper(world, domObject)) 233 238 return wrapper; 234 return world.m_wrappers.get( domObject);239 return world.m_wrappers.get(wrapperKey(domObject)); 235 240 } 236 241 … … 240 245 if (setInlineCachedWrapper(world, domObject, wrapper, owner)) 241 246 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)); 243 248 } 244 249 … … 247 252 if (clearInlineCachedWrapper(world, domObject, wrapper)) 248 253 return; 249 weakRemove(world.m_wrappers, (void*)domObject, wrapper);254 weakRemove(world.m_wrappers, wrapperKey(domObject), wrapper); 250 255 } 251 256 -
trunk/Source/WebCore/bindings/js/JSTrackCustom.cpp
r191887 r196466 59 59 return jsNull(); 60 60 61 JSObject* wrapper = getCachedWrapper(globalObject->world(), track);62 if (wrapper)63 return wrapper;64 65 61 switch (track->type()) { 66 62 case TrackBase::BaseTrack: … … 70 66 71 67 case TrackBase::AudioTrack: 68 if (auto* wrapper = getCachedWrapper(globalObject->world(), toAudioTrack(track))) 69 return wrapper; 72 70 return CREATE_DOM_WRAPPER(globalObject, AudioTrack, track); 73 71 74 72 case TrackBase::VideoTrack: 73 if (auto* wrapper = getCachedWrapper(globalObject->world(), toVideoTrack(track))) 74 return wrapper; 75 75 return CREATE_DOM_WRAPPER(globalObject, VideoTrack, track); 76 76 77 77 case TrackBase::TextTrack: 78 if (auto* wrapper = getCachedWrapper(globalObject->world(), toTextTrack(track))) 79 return wrapper; 78 80 return CREATE_DOM_WRAPPER(globalObject, TextTrack, track); 79 81 } -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
r195289 r196466 1922 1922 my ($object, $interface, $defines) = @_; 1923 1923 1924 # FIXME: GObject bindings do not support EventTarget as base class. 1925 $interface->parent(undef) if $interface->parent && $interface->parent eq "EventTarget"; 1926 1924 1927 # Set up some global variables 1925 1928 $className = GetClassName($interface->name); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r196423 r196466 532 532 533 533 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"; 537 536 return 0; 538 537 } … … 561 560 return 0 if $interface->name eq "AbstractView"; 562 561 return 1 if (!$hasParent or $interface->extendedAttributes->{"JSGenerateToJSObject"} or $interface->extendedAttributes->{"CustomToJSObject"}); 562 return 1 if $interface->parent && $interface->parent eq "EventTarget"; 563 563 return 0; 564 564 } … … 1242 1242 push(@headerContent, " static NeverDestroyed<JS${interfaceName}Owner> owner;\n"); 1243 1243 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"); 1244 1249 push(@headerContent, "}\n"); 1245 1250 push(@headerContent, "\n"); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
r193637 r196466 361 361 362 362 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 363 367 my $className = GetClassName($name); 364 368 my $parentClassName = "DOM" . GetParentImplClassName($interface); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h
r196423 r196466 79 79 } 80 80 81 inline void* wrapperKey(TestActiveDOMObject* domObject) 82 { 83 return domObject; 84 } 85 81 86 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestActiveDOMObject*); 82 87 inline 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 78 78 } 79 79 80 inline void* wrapperKey(TestClassWithJSBuiltinConstructor* domObject) 81 { 82 return domObject; 83 } 84 80 85 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestClassWithJSBuiltinConstructor*); 81 86 inline 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 75 75 } 76 76 77 inline void* wrapperKey(TestCustomConstructorWithNoInterfaceObject* domObject) 78 { 79 return domObject; 80 } 81 77 82 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomConstructorWithNoInterfaceObject*); 78 83 inline 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 82 82 } 83 83 84 inline void* wrapperKey(TestCustomNamedGetter* domObject) 85 { 86 return domObject; 87 } 88 84 89 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomNamedGetter*); 85 90 inline 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 78 78 } 79 79 80 inline void* wrapperKey(TestEventConstructor* domObject) 81 { 82 return domObject; 83 } 84 80 85 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventConstructor*); 81 86 inline 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 22 22 #include "JSTestEventTarget.h" 23 23 24 #include "Event.h"25 24 #include "ExceptionCode.h" 26 25 #include "JSDOMBinding.h" 27 26 #include "JSDOMConstructor.h" 28 #include "JSEvent.h"29 #include "JSEventListener.h"30 27 #include "JSNode.h" 31 28 #include "Node.h" 32 29 #include "wtf/text/AtomicString.h" 33 30 #include <runtime/Error.h> 34 #include <runtime/FunctionPrototype.h>35 31 #include <runtime/PropertyNameArray.h> 36 32 #include <wtf/GetPtr.h> … … 43 39 44 40 JSC::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*);48 41 49 42 // Attributes … … 81 74 template<> JSValue JSTestEventTargetConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) 82 75 { 83 UNUSED_PARAM(vm); 84 return globalObject.functionPrototype(); 76 return JSEventTarget::getConstructor(vm, &globalObject); 85 77 } 86 78 … … 100 92 { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestEventTargetConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestEventTargetConstructor) } }, 101 93 { "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) } },105 94 }; 106 95 … … 116 105 117 106 JSTestEventTarget::JSTestEventTarget(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestEventTarget>&& impl) 118 : JS DOMWrapper<TestEventTarget>(structure, globalObject, WTFMove(impl))107 : JSEventTarget(structure, globalObject, WTFMove(impl)) 119 108 { 120 109 } … … 122 111 JSObject* JSTestEventTarget::createPrototype(VM& vm, JSGlobalObject* globalObject) 123 112 { 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))); 125 114 } 126 115 … … 128 117 { 129 118 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();136 119 } 137 120 … … 230 213 } 231 214 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 282 215 void JSTestEventTarget::visitChildren(JSCell* cell, SlotVisitor& visitor) 283 216 { … … 286 219 Base::visitChildren(thisObject, visitor); 287 220 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);304 221 } 305 222 -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
r196423 r196466 22 22 #define JSTestEventTarget_h 23 23 24 #include "JS DOMWrapper.h"24 #include "JSEventTarget.h" 25 25 #include "TestEventTarget.h" 26 #include <wtf/NeverDestroyed.h>27 26 28 27 namespace WebCore { 29 28 30 class JSTestEventTarget : public JS DOMWrapper<TestEventTarget>{29 class JSTestEventTarget : public JSEventTarget { 31 30 public: 32 typedef JS DOMWrapper<TestEventTarget>Base;31 typedef JSEventTarget Base; 33 32 static JSTestEventTarget* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestEventTarget>&& impl) 34 33 { … … 46 45 static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&); 47 46 static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&); 48 static void destroy(JSC::JSCell*);49 47 50 48 DECLARE_INFO; … … 59 57 static void visitChildren(JSCell*, JSC::SlotVisitor&); 60 58 59 TestEventTarget& wrapped() const 60 { 61 return static_cast<TestEventTarget&>(Base::wrapped()); 62 } 61 63 public: 62 64 static const unsigned StructureFlags = JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::MasqueradesAsUndefined | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags; … … 74 76 }; 75 77 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 88 78 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventTarget*); 89 79 inline 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 80 80 } 81 81 82 inline void* wrapperKey(TestException* domObject) 83 { 84 return domObject; 85 } 86 82 87 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestException*); 83 88 inline 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 76 76 } 77 77 78 inline void* wrapperKey(TestGenerateIsReachable* domObject) 79 { 80 return domObject; 81 } 82 78 83 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestGenerateIsReachable*); 79 84 inline 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 103 103 } 104 104 105 inline void* wrapperKey(TestInterface* domObject) 106 { 107 return domObject; 108 } 109 105 110 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestInterface*); 106 111 inline 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 76 76 } 77 77 78 inline void* wrapperKey(TestMediaQueryListListener* domObject) 79 { 80 return domObject; 81 } 82 78 83 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestMediaQueryListListener*); 79 84 inline 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 77 77 } 78 78 79 inline void* wrapperKey(TestNamedConstructor* domObject) 80 { 81 return domObject; 82 } 83 79 84 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedConstructor*); 80 85 inline 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 76 76 } 77 77 78 inline void* wrapperKey(TestNondeterministic* domObject) 79 { 80 return domObject; 81 } 82 78 83 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNondeterministic*); 79 84 inline 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 92 92 } 93 93 94 inline void* wrapperKey(TestObj* domObject) 95 { 96 return domObject; 97 } 98 94 99 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestObj*); 95 100 inline 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 76 76 } 77 77 78 inline void* wrapperKey(TestOverloadedConstructors* domObject) 79 { 80 return domObject; 81 } 82 78 83 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverloadedConstructors*); 79 84 inline 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 83 83 } 84 84 85 inline void* wrapperKey(TestOverrideBuiltins* domObject) 86 { 87 return domObject; 88 } 89 85 90 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverrideBuiltins*); 86 91 inline 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 82 82 } 83 83 84 inline void* wrapperKey(TestSerializedScriptValueInterface* domObject) 85 { 86 return domObject; 87 } 88 84 89 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface*); 85 90 inline 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 79 79 } 80 80 81 inline void* wrapperKey(TestTypedefs* domObject) 82 { 83 return domObject; 84 } 85 81 86 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestTypedefs*); 82 87 inline 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 77 77 } 78 78 79 inline void* wrapperKey(attribute* domObject) 80 { 81 return domObject; 82 } 83 79 84 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, attribute*); 80 85 inline 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 76 76 } 77 77 78 inline void* wrapperKey(readonly* domObject) 79 { 80 return domObject; 81 } 82 78 83 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, readonly*); 79 84 inline 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 27 27 #import <WebCore/DOMObject.h> 28 28 29 @class DOMEvent;30 29 @class DOMNode; 31 @class NSString;32 @protocol DOMEventListener;33 30 34 31 WEBKIT_CLASS_AVAILABLE_MAC(9876_5) 35 32 WEBCORE_EXPORT @interface DOMTestEventTarget : DOMObject 36 33 - (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;40 34 @end -
trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.mm
r193378 r196466 33 33 #import "DOMNodeInternal.h" 34 34 #import "DOMTestEventTargetInternal.h" 35 #import "Event.h"36 #import "EventListener.h"37 35 #import "ExceptionHandlers.h" 38 36 #import "JSMainThreadExecState.h" 39 37 #import "Node.h" 40 #import "ObjCEventListener.h"41 38 #import "TestEventTarget.h" 42 39 #import "ThreadCheck.h" 43 #import "URL.h"44 40 #import "WebCoreObjCExtras.h" 45 41 #import "WebScriptObjectPrivate.h" … … 66 62 } 67 63 68 - (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture69 {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)useCapture76 {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 *)evt83 {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 91 64 @end 92 65 -
trunk/Source/WebCore/bindings/scripts/test/TestEventTarget.idl
r189770 r196466 30 30 EventTarget, 31 31 MasqueradesAsUndefined 32 ] interface TestEventTarget {32 ] interface TestEventTarget : EventTarget { 33 33 34 34 getter Node item(unsigned long index); 35 35 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);44 36 }; 45 37 -
trunk/Source/WebCore/css/FontLoader.idl
r181507 r196466 35 35 EventTarget, 36 36 GenerateIsReachable=ImplDocument, 37 ] interface FontLoader {37 ] interface FontLoader : EventTarget { 38 38 39 39 attribute EventHandler onloading; … … 47 47 void notifyWhenFontsReady(VoidCallback callback); 48 48 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);53 49 }; -
trunk/Source/WebCore/dom/EventTarget.h
r192354 r196466 35 35 #include "EventNames.h" 36 36 #include "EventTargetInterfaces.h" 37 #include "ScriptWrappable.h" 37 38 #include <memory> 38 39 #include <wtf/Forward.h> … … 109 110 }; 110 111 111 class EventTarget {112 class EventTarget : public ScriptWrappable { 112 113 public: 113 114 void ref() { refEventTarget(); } -
trunk/Source/WebCore/dom/MessagePort.idl
r181507 r196466 31 31 ActiveDOMObject, 32 32 EventTarget, 33 ] interface MessagePort {33 ] interface MessagePort : EventTarget { 34 34 // We need to have something as an ObjC binding, because MessagePort is used in MessageEvent, which already has one, 35 35 // but we don't want to actually expose the API while it is in flux. … … 41 41 42 42 attribute EventHandler onmessage; 43 44 // EventTarget interface45 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);48 43 #endif 49 44 }; -
trunk/Source/WebCore/dom/Node.h
r196123 r196466 31 31 #include "MutationObserver.h" 32 32 #include "RenderStyleConstants.h" 33 #include "ScriptWrappable.h"34 33 #include "TreeScope.h" 35 34 #include <wtf/Forward.h> … … 114 113 }; 115 114 116 class Node : public EventTarget , public ScriptWrappable{115 class Node : public EventTarget { 117 116 WTF_MAKE_FAST_ALLOCATED; 118 117 -
trunk/Source/WebCore/dom/Node.idl
r195682 r196466 26 26 CustomToJSObject, 27 27 EventTarget, 28 JSGenerateToNativeObject,29 28 ObjCPolymorphic, 30 29 ] interface Node 31 30 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 32 31 : Object, EventTarget 33 #endif /* defined(LANGUAGE_OBJECTIVE_C) */ 32 #else 33 : EventTarget 34 #endif 34 35 { 35 36 // NodeType … … 126 127 void inspect(); 127 128 #endif 128 129 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C130 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 #endif134 135 129 }; 136 130 -
trunk/Source/WebCore/dom/WebKitNamedFlow.idl
r181507 r196466 31 31 NoInterfaceObject, 32 32 EventTarget, 33 JSGenerateToJSObject,34 33 GenerateIsReachable=ImplOwnerNodeRoot, 35 ] interface WebKitNamedFlow { 34 ] interface WebKitNamedFlow 35 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT 36 : EventTarget 37 #endif 38 { 36 39 readonly attribute DOMString name; 37 40 readonly attribute boolean overset; … … 40 43 NodeList getRegions(); 41 44 NodeList getContent(); 42 43 // EventTarget interface44 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);47 45 }; -
trunk/Source/WebCore/fileapi/FileReader.idl
r181507 r196466 36 36 ConstructorCallWith=ScriptExecutionContext, 37 37 EventTarget, 38 ] interface FileReader {38 ] interface FileReader : EventTarget { 39 39 // ready states 40 40 const unsigned short EMPTY = 0; … … 56 56 readonly attribute FileError error; 57 57 58 // EventTarget interface59 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 63 58 attribute EventHandler onloadstart; 64 59 attribute EventHandler onprogress; -
trunk/Source/WebCore/html/MediaController.idl
r181507 r196466 28 28 Constructor, 29 29 ConstructorCallWith=ScriptExecutionContext, 30 JSGenerateToJSObject,31 30 EventTarget, 32 ] interface MediaController {31 ] interface MediaController : EventTarget { 33 32 readonly attribute TimeRanges buffered; 34 33 readonly attribute TimeRanges seekable; … … 49 48 [SetterRaisesException] attribute unrestricted double volume; 50 49 attribute boolean muted; 51 52 // EventTarget interface53 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);56 50 }; -
trunk/Source/WebCore/html/track/AudioTrackList.idl
r181507 r196466 30 30 EventTarget, 31 31 JSCustomMarkFunction, 32 ] interface AudioTrackList {32 ] interface AudioTrackList : EventTarget { 33 33 readonly attribute unsigned long length; 34 34 getter AudioTrack item(unsigned long index); … … 38 38 attribute EventHandler onaddtrack; 39 39 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);44 40 }; 45 41 -
trunk/Source/WebCore/html/track/TextTrack.idl
r188660 r196466 33 33 JSCustomMarkFunction, 34 34 SkipVTableValidation, 35 ] interface TextTrack {35 ] interface TextTrack : EventTarget { 36 36 readonly attribute DOMString id; 37 37 [CustomSetter] attribute TextTrackKind kind; … … 55 55 [RaisesException] void removeRegion(VTTRegion region); 56 56 #endif 57 58 // EventTarget interface59 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 57 }; -
trunk/Source/WebCore/html/track/TextTrackCue.idl
r181507 r196466 26 26 [ 27 27 Conditional=VIDEO_TRACK, 28 JSGenerateToNativeObject,29 28 Constructor(unrestricted double startTime, unrestricted double endTime, DOMString text), 30 29 ConstructorCallWith=ScriptExecutionContext, … … 34 33 CustomToJSObject, 35 34 SkipVTableValidation, 36 ] interface TextTrackCue {35 ] interface TextTrackCue : EventTarget { 37 36 readonly attribute TextTrack track; 38 37 … … 44 43 attribute EventHandler onenter; 45 44 attribute EventHandler onexit; 46 47 // EventTarget interface48 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);51 45 }; 52 46 -
trunk/Source/WebCore/html/track/TextTrackList.idl
r181507 r196466 29 29 EventTarget, 30 30 JSCustomMarkFunction, 31 ] interface TextTrackList {31 ] interface TextTrackList : EventTarget { 32 32 readonly attribute unsigned long length; 33 33 getter TextTrack item(unsigned long index); … … 37 37 attribute EventHandler onchange; 38 38 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);43 39 }; 44 40 -
trunk/Source/WebCore/html/track/VideoTrackList.idl
r181507 r196466 30 30 EventTarget, 31 31 JSCustomMarkFunction, 32 ] interface VideoTrackList {32 ] interface VideoTrackList : EventTarget { 33 33 readonly attribute unsigned long length; 34 34 getter VideoTrack item(unsigned long index); … … 39 39 attribute EventHandler onaddtrack; 40 40 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);45 41 }; 46 42 -
trunk/Source/WebCore/loader/appcache/DOMApplicationCache.h
r192848 r196466 42 42 class URL; 43 43 44 class DOMApplicationCache final : public ScriptWrappable, publicRefCounted<DOMApplicationCache>, public EventTargetWithInlineData, public DOMWindowProperty {44 class DOMApplicationCache final : public RefCounted<DOMApplicationCache>, public EventTargetWithInlineData, public DOMWindowProperty { 45 45 public: 46 46 static Ref<DOMApplicationCache> create(Frame* frame) { return adoptRef(*new DOMApplicationCache(frame)); } -
trunk/Source/WebCore/loader/appcache/DOMApplicationCache.idl
r195729 r196466 29 29 GenerateIsReachable=ImplFrame, 30 30 InterfaceName=ApplicationCache, 31 ] interface DOMApplicationCache {31 ] interface DOMApplicationCache : EventTarget { 32 32 // update status 33 33 const unsigned short UNCACHED = 0; … … 51 51 attribute EventHandler oncached; 52 52 attribute EventHandler onobsolete; 53 54 // EventTarget interface55 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);58 53 }; 59 54 -
trunk/Source/WebCore/page/EventSource.idl
r181507 r196466 37 37 ConstructorRaisesException, 38 38 EventTarget, 39 ] interface EventSource {39 ] interface EventSource : EventTarget { 40 40 41 41 readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons. … … 54 54 attribute EventHandler onerror; 55 55 void close(); 56 57 // EventTarget interface58 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 62 56 }; -
trunk/Source/WebCore/page/Performance.h
r192582 r196466 53 53 class UserTiming; 54 54 55 class Performance final : public ScriptWrappable, publicRefCounted<Performance>, public DOMWindowProperty, public EventTargetWithInlineData {55 class Performance final : public RefCounted<Performance>, public DOMWindowProperty, public EventTargetWithInlineData { 56 56 public: 57 57 static Ref<Performance> create(Frame& frame) { return adoptRef(*new Performance(frame)); } -
trunk/Source/WebCore/page/Performance.idl
r181507 r196466 34 34 Conditional=WEB_TIMING, 35 35 EventTarget, 36 ] interface Performance {36 ] interface Performance : EventTarget { 37 37 readonly attribute PerformanceNavigation navigation; 38 38 readonly attribute PerformanceTiming timing; -
trunk/Source/WebCore/workers/Worker.idl
r181507 r196466 28 28 [ 29 29 CustomConstructor(DOMString scriptUrl), 30 JSGenerateToNativeObject,31 JSGenerateToJSObject,32 30 ActiveDOMObject, 33 31 ] interface Worker : EventTarget { -
trunk/Source/WebCore/xml/XMLHttpRequest.h
r192848 r196466 50 50 class ThreadableLoader; 51 51 52 class XMLHttpRequest final : public ScriptWrappable, publicRefCounted<XMLHttpRequest>, public EventTargetWithInlineData, private ThreadableLoaderClient, public ActiveDOMObject {52 class XMLHttpRequest final : public RefCounted<XMLHttpRequest>, public EventTargetWithInlineData, private ThreadableLoaderClient, public ActiveDOMObject { 53 53 WTF_MAKE_FAST_ALLOCATED; 54 54 public: -
trunk/Source/WebCore/xml/XMLHttpRequest.idl
r190025 r196466 43 43 JSCustomMarkFunction, 44 44 EventTarget, 45 ] interface XMLHttpRequest {45 ] interface XMLHttpRequest : EventTarget { 46 46 // From XMLHttpRequestEventTarget 47 47 attribute EventHandler onabort; … … 92 92 // Extension 93 93 [RaisesException] void overrideMimeType(DOMString override); 94 95 // EventTarget interface96 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);99 94 }; -
trunk/Source/WebCore/xml/XMLHttpRequestUpload.idl
r192256 r196466 30 30 GenerateIsReachable=Impl, 31 31 EventTarget, 32 ] interface XMLHttpRequestUpload {32 ] interface XMLHttpRequestUpload : EventTarget { 33 33 // From XMLHttpRequestEventTarget 34 34 attribute EventHandler onabort; … … 39 39 attribute EventHandler onprogress; 40 40 attribute EventHandler ontimeout; 41 42 // EventTarget interface43 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);46 41 }; 47 42
Note: See TracChangeset
for help on using the changeset viewer.