Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Issue 18778002: Inherit EventTarget interface instead of duplicating its code (Closed)

Created:
7 years, 5 months ago by do-not-use
Modified:
7 years, 5 months ago
CC:
blink-reviews, eae+blinkwatch, dgrogan, adamk+blink_chromium.org, pdr, Nils Barth (inactive), chromiumbugtracker_adobe.com, alecflett, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, gavinp+loader_chromium.org, kinuko, feature-media-reviews_chromium.org, tommyw+watchlist_chromium.org, darktears, Nate Chapin, vcarbune.chromium, jsbell, jsbell+bindings_chromium.org, f(malita), apavlov+blink_chromium.org, Stephen Chennney, lgombos
Visibility:
Public.

Description

Inherit EventTarget interface instead of duplicating its code Update most interfaces to stop using [EventTarget] IDL extended attribute and inherit EventTarget instead. This avoids duplicating the EventTarget API in each IDL and makes our IDL more standard. Also remove [NoInterfaceObject] extended attribute from EventTarget to facilitate testing and match the specification: http://dom.spec.whatwg.org/#interface-eventtarget Only 3 interfaces were not updated yet (Node, Window, Performance) because they require special treatment at the moment. BUG=257583 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=153867

Patch Set 1 #

Total comments: 5

Patch Set 2 : Add LayoutTest and expose EventTarget #

Patch Set 3 : Move test to webexposed and rebaline 2 others #

Patch Set 4 : Implement Dominic's proposal #

Patch Set 5 : Implement Dominic's proposal #

Patch Set 6 : Rebase on master #

Patch Set 7 : Fix clang build #

Patch Set 8 : Fix the regressions #

Total comments: 3

Patch Set 9 : Take arv's feedback into consideration #

Patch Set 10 : Rename methods as suggested #

Patch Set 11 : Rebase on master #

Patch Set 12 : Rebase on master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+540 lines, -745 lines) Patch
M LayoutTests/fast/dom/dom-constructors.html View 1 2 2 chunks +1 line, -1 line 0 comments Download
M LayoutTests/fast/dom/dom-constructors-expected.txt View 1 2 2 chunks +1 line, -1 line 0 comments Download
A LayoutTests/webexposed/event-target-in-prototype.html View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
A LayoutTests/webexposed/event-target-in-prototype-expected.txt View 1 2 1 chunk +17 lines, -0 lines 0 comments Download
M LayoutTests/webexposed/global-constructors-listing-expected.txt View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/scripts/CodeGeneratorV8.pm View 1 2 3 4 5 6 7 8 9 10 11 17 chunks +41 lines, -18 lines 0 comments Download
M Source/bindings/tests/idls/TestEventTarget.idl View 2 chunks +1 line, -10 lines 0 comments Download
M Source/bindings/tests/results/V8Float64Array.h View 1 2 3 4 5 6 7 8 9 6 chunks +14 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/V8Float64Array.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/V8TestActiveDOMObject.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestActiveDOMObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/V8TestCustomAccessors.h View 1 2 3 4 5 6 7 8 9 7 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestCustomAccessors.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/V8TestEvent.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestEvent.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/V8TestEventConstructor.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestEventConstructor.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/V8TestEventTarget.h View 1 2 3 4 5 6 7 8 9 7 chunks +16 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestEventTarget.cpp View 1 2 3 4 5 6 7 8 9 7 chunks +7 lines, -75 lines 0 comments Download
M Source/bindings/tests/results/V8TestException.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestException.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/V8TestExtendedEvent.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestExtendedEvent.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterface.h View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterface.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterfaceImplementedAs.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/V8TestMediaQueryListListener.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestMediaQueryListListener.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/V8TestNamedConstructor.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestNamedConstructor.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -5 lines 0 comments Download
M Source/bindings/tests/results/V8TestNode.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestNode.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.h View 1 2 3 4 5 6 7 8 9 7 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +8 lines, -8 lines 0 comments Download
M Source/bindings/tests/results/V8TestOverloadedConstructors.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestOverloadedConstructors.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +8 lines, -8 lines 0 comments Download
M Source/bindings/tests/results/V8TestSerializedScriptValueInterface.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestSerializedScriptValueInterface.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -4 lines 0 comments Download
M Source/bindings/tests/results/V8TestTypedefs.h View 1 2 3 4 5 6 7 8 9 6 chunks +15 lines, -6 lines 0 comments Download
M Source/bindings/tests/results/V8TestTypedefs.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +5 lines, -5 lines 0 comments Download
M Source/bindings/v8/CustomElementWrapper.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/v8/DOMDataStore.h View 1 2 3 4 5 6 7 8 9 4 chunks +15 lines, -15 lines 0 comments Download
M Source/bindings/v8/SerializedScriptValue.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/v8/V8CustomElementLifecycleCallbacks.cpp View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/V8DOMWrapper.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -4 lines 0 comments Download
M Source/bindings/v8/V8WindowShell.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/WorkerScriptController.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/custom/V8ArrayBufferCustom.h View 1 2 3 4 5 6 7 8 9 6 chunks +16 lines, -5 lines 0 comments Download
M Source/bindings/v8/custom/V8ArrayBufferCustom.cpp View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M Source/bindings/v8/custom/V8ArrayBufferViewCustom.h View 1 2 3 7 chunks +8 lines, -8 lines 0 comments Download
M Source/bindings/v8/custom/V8AudioContextCustom.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/custom/V8DataViewCustom.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/bindings/v8/custom/V8FormDataCustom.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/custom/V8HTMLImageElementConstructor.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/custom/V8MessageChannelCustom.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/custom/V8MutationObserverCustom.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/custom/V8WebKitPointCustom.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/FontLoader.idl View 2 chunks +1 line, -10 lines 0 comments Download
M Source/core/dom/EventTarget.idl View 1 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/dom/MessagePort.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/core/dom/WebKitNamedFlow.idl View 1 chunk +1 line, -11 lines 0 comments Download
M Source/core/fileapi/FileReader.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/core/html/MediaController.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/core/html/track/TextTrack.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/core/html/track/TextTrackCue.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/core/html/track/TextTrackList.idl View 1 chunk +1 line, -10 lines 0 comments Download
M Source/core/loader/appcache/DOMApplicationCache.idl View 2 chunks +1 line, -11 lines 0 comments Download
M Source/core/page/EventSource.idl View 2 chunks +2 lines, -13 lines 0 comments Download
M Source/core/svg/SVGElementInstance.idl View 1 chunk +1 line, -3 lines 0 comments Download
M Source/core/workers/WorkerGlobalScope.idl View 2 chunks +1 line, -11 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/core/xml/XMLHttpRequestUpload.idl View 2 chunks +1 line, -12 lines 0 comments Download
M Source/modules/encryptedmedia/MediaKeySession.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/modules/filesystem/FileWriter.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/modules/indexeddb/IDBDatabase.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/modules/indexeddb/IDBOpenDBRequest.idl View 1 1 chunk +1 line, -3 lines 0 comments Download
M Source/modules/indexeddb/IDBRequest.idl View 1 2 chunks +2 lines, -12 lines 0 comments Download
M Source/modules/indexeddb/IDBTransaction.idl View 2 chunks +2 lines, -11 lines 0 comments Download
M Source/modules/mediasource/MediaSource.idl View 2 chunks +1 line, -11 lines 0 comments Download
M Source/modules/mediasource/SourceBuffer.idl View 2 chunks +1 line, -11 lines 0 comments Download
M Source/modules/mediasource/SourceBufferList.idl View 1 chunk +1 line, -11 lines 0 comments Download
M Source/modules/mediasource/WebKitMediaSource.idl View 2 chunks +1 line, -11 lines 0 comments Download
M Source/modules/mediasource/WebKitSourceBufferList.idl View 1 chunk +2 lines, -12 lines 0 comments Download
M Source/modules/mediastream/MediaStream.idl View 2 chunks +1 line, -11 lines 0 comments Download
M Source/modules/mediastream/MediaStreamTrack.idl View 2 chunks +1 line, -11 lines 0 comments Download
M Source/modules/mediastream/RTCDTMFSender.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/modules/mediastream/RTCDataChannel.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/modules/mediastream/RTCPeerConnection.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/modules/notifications/Notification.idl View 2 chunks +1 line, -11 lines 0 comments Download
M Source/modules/speech/SpeechRecognition.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/modules/speech/SpeechSynthesisUtterance.idl View 1 chunk +1 line, -2 lines 0 comments Download
M Source/modules/webaudio/AudioContext.idl View 1 chunk +2 lines, -3 lines 0 comments Download
M Source/modules/webaudio/AudioNode.idl View 1 chunk +0 lines, -10 lines 0 comments Download
M Source/modules/webaudio/OfflineAudioContext.idl View 1 chunk +0 lines, -1 line 0 comments Download
M Source/modules/webmidi/MIDIAccess.idl View 1 chunk +2 lines, -12 lines 0 comments Download
M Source/modules/webmidi/MIDIInput.idl View 1 chunk +1 line, -2 lines 0 comments Download
M Source/modules/webmidi/MIDIPort.idl View 2 chunks +2 lines, -12 lines 0 comments Download
M Source/modules/websockets/WebSocket.idl View 2 chunks +2 lines, -12 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
do-not-use
7 years, 5 months ago (2013-07-05 14:42:36 UTC) #1
do-not-use
https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h File Source/core/css/FontLoader.h (right): https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h#newcode50 Source/core/css/FontLoader.h:50: class FontLoader : public EventTarget, public RefCounted<FontLoader>, public ActiveDOMObject ...
7 years, 5 months ago (2013-07-05 14:44:04 UTC) #2
do-not-use
https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h File Source/core/css/FontLoader.h (right): https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h#newcode50 Source/core/css/FontLoader.h:50: class FontLoader : public EventTarget, public RefCounted<FontLoader>, public ActiveDOMObject ...
7 years, 5 months ago (2013-07-05 14:47:44 UTC) #3
haraken
This looks great!! I guess this CL changes web-exposed behavior: (before) Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, "addEventListener"); // [Object] ...
7 years, 5 months ago (2013-07-06 00:29:55 UTC) #4
haraken
https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h File Source/core/css/FontLoader.h (right): https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h#newcode50 Source/core/css/FontLoader.h:50: class FontLoader : public EventTarget, public RefCounted<FontLoader>, public ActiveDOMObject ...
7 years, 5 months ago (2013-07-06 01:21:00 UTC) #5
do-not-use
On 2013/07/06 01:21:00, haraken wrote: > https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h > File Source/core/css/FontLoader.h (right): > > https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h#newcode50 > ...
7 years, 5 months ago (2013-07-06 17:22:36 UTC) #6
arv (Not doing code reviews)
I think it is fine to change the order here. Can we add tests that ...
7 years, 5 months ago (2013-07-06 19:20:28 UTC) #7
dominicc (has gone to gerrit)
https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h File Source/core/css/FontLoader.h (right): https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h#newcode50 Source/core/css/FontLoader.h:50: class FontLoader : public EventTarget, public RefCounted<FontLoader>, public ActiveDOMObject ...
7 years, 5 months ago (2013-07-07 00:14:28 UTC) #8
haraken
> The resulting binary is ~450Kb smaller BTW, I'm curious about where the diet comes ...
7 years, 5 months ago (2013-07-08 01:59:02 UTC) #9
do-not-use
On 2013/07/08 01:59:02, haraken wrote: > > The resulting binary is ~450Kb smaller > > ...
7 years, 5 months ago (2013-07-08 06:16:20 UTC) #10
do-not-use
On 2013/07/08 06:16:20, Christophe Dumez wrote: > On 2013/07/08 01:59:02, haraken wrote: > > > ...
7 years, 5 months ago (2013-07-08 07:00:43 UTC) #11
haraken
> > Yes, not duplicating those 3 methods' implementation in these 40 classes seems > ...
7 years, 5 months ago (2013-07-08 07:06:25 UTC) #12
do-not-use
On 2013/07/08 07:06:25, haraken wrote: > > > Yes, not duplicating those 3 methods' implementation ...
7 years, 5 months ago (2013-07-08 07:22:19 UTC) #13
haraken
The test looks good. What do you think about dominicc's opinion?
7 years, 5 months ago (2013-07-08 07:36:33 UTC) #14
do-not-use
On 2013/07/08 07:36:33, haraken wrote: > The test looks good. What do you think about ...
7 years, 5 months ago (2013-07-08 07:43:10 UTC) #15
do-not-use
On 2013/07/08 07:06:25, haraken wrote: > > > Yes, not duplicating those 3 methods' implementation ...
7 years, 5 months ago (2013-07-08 07:50:03 UTC) #16
haraken
dominicc: Your point is that we can clean up the code by introducing toWrappedType/fromWrappedType and ...
7 years, 5 months ago (2013-07-08 07:52:45 UTC) #17
haraken
Christophe: You might want to put the test to webexposed/.
7 years, 5 months ago (2013-07-08 07:54:30 UTC) #18
do-not-use
On 2013/07/08 07:54:30, haraken wrote: > Christophe: You might want to put the test to ...
7 years, 5 months ago (2013-07-08 07:59:31 UTC) #19
haraken
LGTM. Please wait for a comment from dominicc.
7 years, 5 months ago (2013-07-08 08:00:21 UTC) #20
dominicc (has gone to gerrit)
On 2013/07/08 07:52:45, haraken wrote: > dominicc: Your point is that we can clean up ...
7 years, 5 months ago (2013-07-08 08:27:36 UTC) #21
haraken
On 2013/07/08 08:27:36, dominicc wrote: > On 2013/07/08 07:52:45, haraken wrote: > > dominicc: Your ...
7 years, 5 months ago (2013-07-08 08:33:33 UTC) #22
do-not-use
On 2013/07/08 08:33:33, haraken wrote: > On 2013/07/08 08:27:36, dominicc wrote: > > On 2013/07/08 ...
7 years, 5 months ago (2013-07-08 09:41:00 UTC) #23
do-not-use
On 2013/07/07 00:14:28, dominicc wrote: > https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h > File Source/core/css/FontLoader.h (right): > > https://codereview.chromium.org/18778002/diff/1/Source/core/css/FontLoader.h#newcode50 > ...
7 years, 5 months ago (2013-07-08 11:05:30 UTC) #24
do-not-use
I implemented Dominic's proposal so that we don't have to change the inheritance order anymore. ...
7 years, 5 months ago (2013-07-08 15:02:20 UTC) #25
arv (Not doing code reviews)
https://codereview.chromium.org/18778002/diff/47001/Source/bindings/scripts/CodeGeneratorV8.pm File Source/bindings/scripts/CodeGeneratorV8.pm (right): https://codereview.chromium.org/18778002/diff/47001/Source/bindings/scripts/CodeGeneratorV8.pm#newcode757 Source/bindings/scripts/CodeGeneratorV8.pm:757: $header{classPublic}->add(" return ${v8ParentClassName}::toWrappedType(impl);\n"); How about storing the return expression ...
7 years, 5 months ago (2013-07-08 15:51:45 UTC) #26
do-not-use
On 2013/07/08 15:51:45, arv wrote: > https://codereview.chromium.org/18778002/diff/47001/Source/bindings/scripts/CodeGeneratorV8.pm > File Source/bindings/scripts/CodeGeneratorV8.pm (right): > > https://codereview.chromium.org/18778002/diff/47001/Source/bindings/scripts/CodeGeneratorV8.pm#newcode757 > ...
7 years, 5 months ago (2013-07-08 16:07:15 UTC) #27
haraken
LGTM toWrappedType/fromWrappedType sounds a bit unclear and confusing to me. It's not related to a ...
7 years, 5 months ago (2013-07-08 23:59:21 UTC) #28
do-not-use
On 2013/07/08 23:59:21, haraken wrote: > LGTM > > toWrappedType/fromWrappedType sounds a bit unclear and ...
7 years, 5 months ago (2013-07-09 06:32:24 UTC) #29
do-not-use
On 2013/07/09 06:32:24, Christophe Dumez wrote: > On 2013/07/08 23:59:21, haraken wrote: > > LGTM ...
7 years, 5 months ago (2013-07-10 06:37:13 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@sisa.samsung.com/18778002/15002
7 years, 5 months ago (2013-07-10 06:40:22 UTC) #31
commit-bot: I haz the power
7 years, 5 months ago (2013-07-10 08:02:30 UTC) #32
Message was sent while issue was closed.
Change committed as 153867

Powered by Google App Engine
This is Rietveld 408576698