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

Issue 1950403002: Add the ability to return descedant event listeners. (Closed)

Created:
4 years, 7 months ago by dtapuska
Modified:
3 years, 9 months ago
Reviewers:
caseq, Rick Byers
CC:
chromium-reviews, caseq+blink_chromium.org, dtapuska+blinkwatch_chromium.org, blink-reviews-events_chromium.org, eae+blinkwatch, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, dglazkov+blink, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, sergeyv+blink_chromium.org, kinuko+watch, kozyatinskiy+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add the ability to return descedant event listeners. Modify the command line query to return the descedant event listeners for a given object. It also accepts a filter string to filter out passive vs blocking listeners. eg. getEventListeners(document, {descendants: true, passive: false}); BUG=609553

Patch Set 1 #

Total comments: 7

Patch Set 2 : Add v8 context check back #

Patch Set 3 : Rebase #

Total comments: 12

Patch Set 4 : Rebase and rewrite to match new flow #

Total comments: 2

Patch Set 5 : Address nits #

Total comments: 18

Patch Set 6 : Address pfeldman's comments #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+538 lines, -54 lines) Patch
M third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html View 1 2 3 4 3 chunks +45 lines, -7 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners-expected.txt View 1 2 3 4 3 chunks +94 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/console/command-line-api-getEventListeners.html View 3 chunks +13 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/console/command-line-api-getEventListeners-expected.txt View 1 2 3 2 chunks +264 lines, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/inspector/console/resources/eventlistener-in-iframe.html View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h View 1 2 3 4 5 3 chunks +9 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp View 1 2 3 4 5 5 chunks +77 lines, -35 lines 4 comments Download
M third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp View 1 2 3 4 5 2 chunks +29 lines, -4 lines 1 comment Download
M third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js View 1 2 3 4 5 1 chunk +1 line, -1 line 1 comment Download
M third_party/WebKit/Source/devtools/protocol.json View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 40 (5 generated)
dtapuska
https://codereview.chromium.org/1950403002/diff/1/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp (left): https://codereview.chromium.org/1950403002/diff/1/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp#oldcode99 third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:99: v8::Local<v8::Context> context = toV8Context(executionContext, v8Listener->world()); Please look at these ...
4 years, 7 months ago (2016-05-05 19:51:42 UTC) #3
caseq
https://codereview.chromium.org/1950403002/diff/1/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp (left): https://codereview.chromium.org/1950403002/diff/1/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp#oldcode99 third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:99: v8::Local<v8::Context> context = toV8Context(executionContext, v8Listener->world()); On 2016/05/05 19:51:42, dtapuska ...
4 years, 7 months ago (2016-05-05 23:00:04 UTC) #4
dtapuska
On 2016/05/05 23:00:04, caseq wrote: > https://codereview.chromium.org/1950403002/diff/1/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp > File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp > (left): > > https://codereview.chromium.org/1950403002/diff/1/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp#oldcode99 ...
4 years, 7 months ago (2016-05-06 13:02:57 UTC) #6
caseq
On 2016/05/06 13:02:57, dtapuska wrote: > I'd really appreciate if we could think about this ...
4 years, 7 months ago (2016-05-09 21:07:13 UTC) #7
caseq
https://codereview.chromium.org/1950403002/diff/1/third_party/WebKit/LayoutTests/inspector/console/resources/eventlistener-in-iframe.html File third_party/WebKit/LayoutTests/inspector/console/resources/eventlistener-in-iframe.html (right): https://codereview.chromium.org/1950403002/diff/1/third_party/WebKit/LayoutTests/inspector/console/resources/eventlistener-in-iframe.html#newcode2 third_party/WebKit/LayoutTests/inspector/console/resources/eventlistener-in-iframe.html:2: window.addEventListener("keydown", function(e) {}); I think we'll need to test ...
4 years, 7 months ago (2016-05-09 21:08:39 UTC) #8
Rick Byers
On 2016/05/09 21:07:13, caseq wrote: > On 2016/05/06 13:02:57, dtapuska wrote: > > I'd really ...
4 years, 7 months ago (2016-05-09 21:17:19 UTC) #9
caseq
On 2016/05/09 21:17:19, Rick Byers wrote: > I didn't realize the command line API had ...
4 years, 7 months ago (2016-05-09 21:24:08 UTC) #10
pfeldman
>> I didn't realize the command line API had a higher security bar than the ...
4 years, 7 months ago (2016-05-10 20:07:40 UTC) #11
dtapuska
On 2016/05/10 20:07:40, pfeldman wrote: > >> I didn't realize the command line API had ...
4 years, 7 months ago (2016-05-11 00:28:55 UTC) #12
caseq
On 2016/05/11 00:28:55, dtapuska wrote: > Do you think it is reasonable to limit the ...
4 years, 7 months ago (2016-05-11 00:54:01 UTC) #13
dtapuska
On 2016/05/11 00:54:01, caseq wrote: > On 2016/05/11 00:28:55, dtapuska wrote: > > Do you ...
4 years, 7 months ago (2016-05-11 01:02:03 UTC) #14
dtapuska
> The important thing here is that the getEventListeners() command line API call > that ...
4 years, 7 months ago (2016-05-11 01:06:33 UTC) #15
caseq
On 2016/05/11 01:06:33, dtapuska wrote: > > > > This sounds like a reasonable first ...
4 years, 7 months ago (2016-05-11 01:10:37 UTC) #16
Rick Byers
On 2016/05/11 01:10:37, caseq wrote: > On 2016/05/11 01:06:33, dtapuska wrote: > > > > ...
4 years, 7 months ago (2016-05-12 01:13:44 UTC) #17
dtapuska
PTAL; I've added back the v8 context check and removed the iframe traversal. As per ...
4 years, 7 months ago (2016-05-18 14:04:53 UTC) #19
caseq
https://codereview.chromium.org/1950403002/diff/30015/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp (right): https://codereview.chromium.org/1950403002/diff/30015/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp#newcode98 third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:98: if (LocalDOMWindow* window = target->toLocalDOMWindow()) { Can we move ...
4 years, 7 months ago (2016-05-20 00:47:24 UTC) #20
caseq
https://codereview.chromium.org/1950403002/diff/30015/third_party/WebKit/Source/devtools/protocol.json File third_party/WebKit/Source/devtools/protocol.json (left): https://codereview.chromium.org/1950403002/diff/30015/third_party/WebKit/Source/devtools/protocol.json#oldcode3918 third_party/WebKit/Source/devtools/protocol.json:3918: "name": "getEventListeners", I guess you also want to update ...
4 years, 7 months ago (2016-05-20 01:00:23 UTC) #21
dtapuska
https://codereview.chromium.org/1950403002/diff/30015/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp (right): https://codereview.chromium.org/1950403002/diff/30015/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp#newcode98 third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:98: if (LocalDOMWindow* window = target->toLocalDOMWindow()) { On 2016/05/20 00:47:24, ...
4 years, 7 months ago (2016-05-26 20:37:44 UTC) #22
caseq
lgtm % comments On 2016/05/26 20:37:44, dtapuska wrote: > https://codereview.chromium.org/1950403002/diff/30015/third_party/WebKit/Source/platform/v8_inspector/public/V8EventListenerInfo.h > File > third_party/WebKit/Source/platform/v8_inspector/public/V8EventListenerInfo.h > ...
4 years, 7 months ago (2016-05-26 22:33:23 UTC) #23
caseq
https://codereview.chromium.org/1950403002/diff/50001/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html File third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html (right): https://codereview.chromium.org/1950403002/diff/50001/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html#newcode90 third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html:90: var expression = "(function(){\n\ why not just expression = ...
4 years, 7 months ago (2016-05-26 22:36:25 UTC) #24
dtapuska
On 2016/05/26 22:36:25, caseq wrote: > https://codereview.chromium.org/1950403002/diff/50001/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html > File > third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-getEventListeners.html > (right): > > ...
4 years, 6 months ago (2016-05-27 15:22:57 UTC) #25
dtapuska
On 2016/05/26 22:33:23, caseq wrote: > lgtm % comments > > On 2016/05/26 20:37:44, dtapuska ...
4 years, 6 months ago (2016-05-27 15:26:14 UTC) #26
dtapuska
On 2016/05/27 15:26:14, dtapuska wrote: > On 2016/05/26 22:33:23, caseq wrote: > > lgtm % ...
4 years, 6 months ago (2016-05-27 15:26:46 UTC) #27
pfeldman
https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h (right): https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h#newcode56 third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h:56: ShowNothing = 0, We don't really need nothing as ...
4 years, 6 months ago (2016-05-27 21:54:01 UTC) #28
dtapuska
https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h (right): https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h#newcode56 third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h:56: ShowNothing = 0, On 2016/05/27 21:54:01, pfeldman wrote: > ...
4 years, 6 months ago (2016-05-27 22:10:53 UTC) #29
dtapuska
https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp File third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp (right): https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp#newcode320 third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp:320: InspectorDOMDebuggerAgent::eventListenersInfoForTarget(isolate, info[0], filterMask, listenerInfo); On 2016/05/27 21:54:01, pfeldman wrote: ...
4 years, 6 months ago (2016-05-27 22:12:39 UTC) #30
caseq
On 2016/05/27 21:54:01, pfeldman wrote: > https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp#newcode320 > third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp:320: > InspectorDOMDebuggerAgent::eventListenersInfoForTarget(isolate, info[0], > filterMask, listenerInfo); ...
4 years, 6 months ago (2016-05-27 22:13:29 UTC) #31
caseq
On 2016/05/27 22:10:53, dtapuska wrote: > https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h > File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h > (right): > > https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h#newcode56 ...
4 years, 6 months ago (2016-05-27 22:19:15 UTC) #32
pfeldman
https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp (right): https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp#newcode84 third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:84: if (context != mainContext) We should use access checks ...
4 years, 6 months ago (2016-05-27 22:32:12 UTC) #33
dtapuska
On 2016/05/27 22:19:15, caseq wrote: > On 2016/05/27 22:10:53, dtapuska wrote: > > > https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h ...
4 years, 6 months ago (2016-05-27 22:32:30 UTC) #34
dtapuska
On 2016/05/27 22:32:30, dtapuska wrote: > On 2016/05/27 22:19:15, caseq wrote: > > On 2016/05/27 ...
4 years, 6 months ago (2016-05-31 21:25:51 UTC) #35
dtapuska
https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp (right): https://codereview.chromium.org/1950403002/diff/70001/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp#newcode84 third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:84: if (context != mainContext) On 2016/05/27 22:32:12, pfeldman wrote: ...
4 years, 6 months ago (2016-05-31 21:26:07 UTC) #36
caseq
https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp File third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp (right): https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp#newcode335 third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp:335: if (info.handler->CreationContext() != context) I think this is the ...
4 years, 6 months ago (2016-05-31 21:36:49 UTC) #37
dtapuska
On 2016/05/31 21:36:49, caseq wrote: > https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp > File third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp (right): > > https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp#newcode335 > ...
4 years, 6 months ago (2016-06-01 14:30:23 UTC) #38
pfeldman
4 years, 6 months ago (2016-06-01 22:40:30 UTC) #39
>> I'd prefer someone with more knowledge of the
v8 bindings to do this than I

Not sure I follow - is there someone picking up this change?

https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
(right):

https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:96:
addEventListenersForEventTarget(target, filterMask, eventInformation);
I don't think this code works for the case of target->toNode().isFrameOwner();

https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:120:
static const char webglErrorFiredEventName[] = "webglErrorFired";
Lets keep constants all together (above methods)

https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:126:
namespace DOMDebuggerAgentState {
This could also be a part of anonymous namespace.

https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp:146:
addEventListenersForEventTargetAndDescendants(target, filterMask,
eventInformation);
We already pass filterMask in, why would we branch here?

https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Sour...
File third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js (right):

https://codereview.chromium.org/1950403002/diff/90001/third_party/WebKit/Sour...
third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js:575:
this.target().domdebuggerAgent().getEventListeners(this._objectId, false,
mycallback.bind(this));
UI should pass the option here.

Powered by Google App Engine
This is Rietveld 408576698