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

Issue 1268353005: [DevTools] Support JQuery event listeners (Closed)

Created:
5 years, 4 months ago by kozy
Modified:
5 years, 3 months ago
CC:
apavlov+blink_chromium.org, blink-reviews, blink-reviews-bindings_chromium.org, caseq+blink_chromium.org, devtools-reviews_chromium.org, kozyatinskiy+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, sergeyv+blink_chromium.org, vivekg_samsung, vivekg, yurys+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

[DevTools] Support JQuery event listeners This CL adds base support of JQuery event listeners. Listeners which was installed by JQuery are shown in Event Listeners sidebar. API for frameworks are provided. Developers can add own event listeners provider to global devtoolsFrameworkEventListeners array (it should be created if undefined). Provider functions should return two arrays: 1. Array with framework event listeners for current object in eventListeners field in format {type: string, useCapture: boolean, handler: function()}. 2. Array with internal framework event handlers for current object in internalHandlers field - one function per each handler. This array is used for filtering out native internal event handlers. BUG=61643 R=yurys@chromium.org,pfeldman@chromium.org

Patch Set 1 : #

Total comments: 24

Patch Set 2 : Added UI #

Total comments: 7

Patch Set 3 : Fixed tests #

Patch Set 4 : #

Total comments: 20

Patch Set 5 : #

Total comments: 12

Patch Set 6 : #

Patch Set 7 : Added missing files #

Total comments: 6

Patch Set 8 : #

Patch Set 9 : Rebased #

Total comments: 2

Patch Set 10 : Implemented in frontend code #

Total comments: 12

Patch Set 11 : #

Total comments: 13

Patch Set 12 : #

Total comments: 16

Patch Set 13 : #

Total comments: 30

Patch Set 14 : #

Total comments: 14

Patch Set 15 : #

Total comments: 15

Patch Set 16 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+659 lines, -30 lines) Patch
M LayoutTests/http/tests/inspector/elements-test.js View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -1 line 0 comments Download
M LayoutTests/inspector/elements/event-listener-sidebar-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -0 lines 0 comments Download
A LayoutTests/inspector/elements/event-listener-sidebar-jquery1.html View 1 2 3 4 5 6 7 8 9 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/inspector/elements/event-listener-sidebar-jquery1-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +30 lines, -0 lines 0 comments Download
A LayoutTests/inspector/elements/event-listener-sidebar-jquery2.html View 1 2 3 4 5 6 7 8 9 1 chunk +42 lines, -0 lines 0 comments Download
A LayoutTests/inspector/elements/event-listener-sidebar-jquery2-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +30 lines, -0 lines 0 comments Download
M LayoutTests/inspector/elements/event-listeners-about-blank-expected.txt View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
A LayoutTests/inspector/elements/resources/jquery-1.11.3.min.js View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
A LayoutTests/inspector/elements/resources/jquery-2.1.4.min.js View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M Source/devtools/devtools.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
A Source/devtools/front_end/components/EventListenersUtils.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +337 lines, -0 lines 0 comments Download
M Source/devtools/front_end/components/EventListenersView.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +118 lines, -11 lines 0 comments Download
M Source/devtools/front_end/components/module.json View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M Source/devtools/front_end/elements/EventListenersWidget.js View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +10 lines, -1 line 0 comments Download
M Source/devtools/front_end/platform/utilities.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -13 lines 0 comments Download
M Source/devtools/front_end/sdk/RemoteObject.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -3 lines 0 comments Download
M Source/devtools/front_end/sdk/RuntimeModel.js View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +19 lines, -1 line 0 comments Download

Depends on Patchset:

Messages

Total messages: 55 (16 generated)
kozy
ptal!
5 years, 4 months ago (2015-08-11 17:56:44 UTC) #4
yurys
Did we decide to do it Firefox way rather than how Paul described in https://code.google.com/p/chromium/issues/detail?id=61643#c30 ...
5 years, 4 months ago (2015-08-11 20:10:40 UTC) #6
yurys
https://codereview.chromium.org/1268353005/diff/60001/LayoutTests/inspector/domdebugger/domdebugger-getEventListeners-jquery2-expected.txt File LayoutTests/inspector/domdebugger/domdebugger-getEventListeners-jquery2-expected.txt (right): https://codereview.chromium.org/1268353005/diff/60001/LayoutTests/inspector/domdebugger/domdebugger-getEventListeners-jquery2-expected.txt#newcode19 LayoutTests/inspector/domdebugger/domdebugger-getEventListeners-jquery2-expected.txt:19: sourceName: domdebugger-getEventListeners.html The expectation is from another test. https://codereview.chromium.org/1268353005/diff/60001/LayoutTests/inspector/domdebugger/domdebugger-getEventListeners-jquery2.html ...
5 years, 4 months ago (2015-08-11 21:10:25 UTC) #7
kozy
All done. Added UI: https://drive.google.com/file/d/0B7RLEApsOKBLX3JuMFl5Q0Z1ZHM/view?usp=sharing https://drive.google.com/file/d/0B7RLEApsOKBLdmtBUUIteWlUczA/view?usp=sharing https://codereview.chromium.org/1268353005/diff/60001/LayoutTests/inspector/domdebugger/domdebugger-getEventListeners-jquery2-expected.txt File LayoutTests/inspector/domdebugger/domdebugger-getEventListeners-jquery2-expected.txt (right): https://codereview.chromium.org/1268353005/diff/60001/LayoutTests/inspector/domdebugger/domdebugger-getEventListeners-jquery2-expected.txt#newcode19 LayoutTests/inspector/domdebugger/domdebugger-getEventListeners-jquery2-expected.txt:19: sourceName: domdebugger-getEventListeners.html On ...
5 years, 4 months ago (2015-08-12 18:02:23 UTC) #8
yurys
https://codereview.chromium.org/1268353005/diff/80001/Source/core/inspector/InjectedScript.cpp File Source/core/inspector/InjectedScript.cpp (right): https://codereview.chromium.org/1268353005/diff/80001/Source/core/inspector/InjectedScript.cpp#newcode38 Source/core/inspector/InjectedScript.cpp:38: #include "bindings/core/v8/V8Node.h" Please don't add dependencies on Blink concepts ...
5 years, 4 months ago (2015-08-12 21:56:03 UTC) #9
paulirish
Can we use the ↪ in front of the location. This will help indicate it ...
5 years, 4 months ago (2015-08-13 05:28:57 UTC) #10
kozy
Framework's event listeners resolving was extracted to frameworks_support module. Developers of frameworks can add own ...
5 years, 4 months ago (2015-08-13 22:02:52 UTC) #15
yurys
https://codereview.chromium.org/1268353005/diff/200001/Source/core/inspector/InjectedScript.cpp File Source/core/inspector/InjectedScript.cpp (right): https://codereview.chromium.org/1268353005/diff/200001/Source/core/inspector/InjectedScript.cpp#newcode429 Source/core/inspector/InjectedScript.cpp:429: ScriptFunctionCall function(injectedScriptObject(), "frameworksEventListeners"); Extract common code into a method. ...
5 years, 4 months ago (2015-08-13 23:49:07 UTC) #16
kozy
Please take a look! https://codereview.chromium.org/1268353005/diff/200001/Source/core/inspector/InjectedScript.cpp File Source/core/inspector/InjectedScript.cpp (right): https://codereview.chromium.org/1268353005/diff/200001/Source/core/inspector/InjectedScript.cpp#newcode429 Source/core/inspector/InjectedScript.cpp:429: ScriptFunctionCall function(injectedScriptObject(), "frameworksEventListeners"); On 2015/08/13 ...
5 years, 4 months ago (2015-08-14 17:07:03 UTC) #17
yurys
lgtm https://codereview.chromium.org/1268353005/diff/220001/Source/core/inspector/InjectedScript.cpp File Source/core/inspector/InjectedScript.cpp (right): https://codereview.chromium.org/1268353005/diff/220001/Source/core/inspector/InjectedScript.cpp#newcode559 Source/core/inspector/InjectedScript.cpp:559: if (!hadException && !result.isEmpty()) Can we simply return ...
5 years, 4 months ago (2015-08-14 17:24:21 UTC) #18
kozy
All Done. Dmitry, could you check that I've added framework_support module correctly? Pavel, please take ...
5 years, 4 months ago (2015-08-14 18:15:46 UTC) #20
dgozman
https://codereview.chromium.org/1268353005/diff/260001/Source/devtools/front_end/framework_support/EventListeners.js File Source/devtools/front_end/framework_support/EventListeners.js (right): https://codereview.chromium.org/1268353005/diff/260001/Source/devtools/front_end/framework_support/EventListeners.js#newcode7 Source/devtools/front_end/framework_support/EventListeners.js:7: WebInspector.FrameworksSupport = {} EventListenersFrameworkSupport https://codereview.chromium.org/1268353005/diff/260001/Source/devtools/front_end/framework_support/EventListeners.js#newcode12 Source/devtools/front_end/framework_support/EventListeners.js:12: WebInspector.FrameworksSupport.eventListenersInitializeFunction = function() ...
5 years, 4 months ago (2015-08-14 19:02:25 UTC) #21
kozy
All done. Please take a look. https://codereview.chromium.org/1268353005/diff/260001/Source/devtools/front_end/framework_support/EventListeners.js File Source/devtools/front_end/framework_support/EventListeners.js (right): https://codereview.chromium.org/1268353005/diff/260001/Source/devtools/front_end/framework_support/EventListeners.js#newcode7 Source/devtools/front_end/framework_support/EventListeners.js:7: WebInspector.FrameworksSupport = {} ...
5 years, 4 months ago (2015-08-14 20:20:38 UTC) #22
paulirish
https://codereview.chromium.org/1268353005/diff/320001/Source/devtools/front_end/elements/EventListenersWidget.js File Source/devtools/front_end/elements/EventListenersWidget.js (right): https://codereview.chromium.org/1268353005/diff/320001/Source/devtools/front_end/elements/EventListenersWidget.js#newcode62 Source/devtools/front_end/elements/EventListenersWidget.js:62: result.toolbar().appendToolbarItem(new WebInspector.ToolbarCheckbox(WebInspector.UIString("Framework user's listeners"), WebInspector.UIString("Show framework user event listeners"), ...
5 years, 4 months ago (2015-08-14 21:03:16 UTC) #24
paulirish
Did you expect to land this before branch?
5 years, 3 months ago (2015-08-24 19:00:28 UTC) #25
kozy
On 2015/08/24 19:00:28, paulirish wrote: > Did you expect to land this before branch? It's ...
5 years, 3 months ago (2015-08-24 20:16:01 UTC) #26
kozy
New implementation uploaded. Please take a look.
5 years, 3 months ago (2015-08-24 23:15:26 UTC) #27
pfeldman
https://codereview.chromium.org/1268353005/diff/340001/Source/devtools/front_end/components/EventListenersView.js File Source/devtools/front_end/components/EventListenersView.js (right): https://codereview.chromium.org/1268353005/diff/340001/Source/devtools/front_end/components/EventListenersView.js#newcode37 Source/devtools/front_end/components/EventListenersView.js:37: promises.push(objects[i].frameworkEventListeners(devtoolsFrameworkEventListeners)); Where is this global method defined? https://codereview.chromium.org/1268353005/diff/340001/Source/devtools/front_end/components/EventListenersView.js#newcode38 Source/devtools/front_end/components/EventListenersView.js:38: ...
5 years, 3 months ago (2015-08-24 23:29:44 UTC) #28
kozy
Reimplemented. Pavel, please take a look.
5 years, 3 months ago (2015-08-26 21:54:25 UTC) #29
pfeldman
Lets extract utilities and land them first. This patch is too large otherwise. https://codereview.chromium.org/1268353005/diff/360001/Source/devtools/front_end/components/EventListenersView.js File ...
5 years, 3 months ago (2015-08-27 01:21:32 UTC) #30
pfeldman
https://codereview.chromium.org/1268353005/diff/360001/Source/devtools/front_end/components/EventListenersView.js File Source/devtools/front_end/components/EventListenersView.js (right): https://codereview.chromium.org/1268353005/diff/360001/Source/devtools/front_end/components/EventListenersView.js#newcode35 Source/devtools/front_end/components/EventListenersView.js:35: addObjects: function(objects) I am trying to understand what it ...
5 years, 3 months ago (2015-08-27 01:30:38 UTC) #31
pfeldman
This is getting close!
5 years, 3 months ago (2015-08-27 01:30:50 UTC) #32
kozy
Pavel, ptal.
5 years, 3 months ago (2015-09-01 23:06:46 UTC) #33
pfeldman
https://codereview.chromium.org/1268353005/diff/380001/Source/devtools/front_end/components/EventListenersUtils.js File Source/devtools/front_end/components/EventListenersUtils.js (right): https://codereview.chromium.org/1268353005/diff/380001/Source/devtools/front_end/components/EventListenersUtils.js#newcode10 Source/devtools/front_end/components/EventListenersUtils.js:10: WebInspector.frameworkEventListeners = function(object, getter) Please don't put anything on ...
5 years, 3 months ago (2015-09-02 02:58:52 UTC) #34
kozy
All done. Please take a look! https://codereview.chromium.org/1268353005/diff/380001/Source/devtools/front_end/components/EventListenersUtils.js File Source/devtools/front_end/components/EventListenersUtils.js (right): https://codereview.chromium.org/1268353005/diff/380001/Source/devtools/front_end/components/EventListenersUtils.js#newcode10 Source/devtools/front_end/components/EventListenersUtils.js:10: WebInspector.frameworkEventListeners = function(object, ...
5 years, 3 months ago (2015-09-02 17:34:13 UTC) #36
pfeldman
As currently implemented, the complexity is outside of my comfort zone. We either need to ...
5 years, 3 months ago (2015-09-02 21:13:26 UTC) #37
kozy
All done. https://codereview.chromium.org/1268353005/diff/420001/Source/devtools/front_end/components/EventListenersUtils.js File Source/devtools/front_end/components/EventListenersUtils.js (right): https://codereview.chromium.org/1268353005/diff/420001/Source/devtools/front_end/components/EventListenersUtils.js#newcode11 Source/devtools/front_end/components/EventListenersUtils.js:11: var listenersResult = {eventListeners: []}; On 2015/09/02 ...
5 years, 3 months ago (2015-09-02 22:40:20 UTC) #38
pfeldman
https://codereview.chromium.org/1268353005/diff/440001/Source/devtools/front_end/components/EventListenersUtils.js File Source/devtools/front_end/components/EventListenersUtils.js (right): https://codereview.chromium.org/1268353005/diff/440001/Source/devtools/front_end/components/EventListenersUtils.js#newcode8 Source/devtools/front_end/components/EventListenersUtils.js:8: WebInspector.FrameworkEventListener; What is the difference between all of these ...
5 years, 3 months ago (2015-09-02 22:55:35 UTC) #39
kozy
All done in EventListenersUtils.. https://codereview.chromium.org/1268353005/diff/440001/Source/devtools/front_end/components/EventListenersUtils.js File Source/devtools/front_end/components/EventListenersUtils.js (right): https://codereview.chromium.org/1268353005/diff/440001/Source/devtools/front_end/components/EventListenersUtils.js#newcode8 Source/devtools/front_end/components/EventListenersUtils.js:8: WebInspector.FrameworkEventListener; On 2015/09/02 22:55:34, pfeldman ...
5 years, 3 months ago (2015-09-03 16:27:52 UTC) #40
pfeldman
https://codereview.chromium.org/1268353005/diff/460001/Source/devtools/front_end/components/EventListenersUtils.js File Source/devtools/front_end/components/EventListenersUtils.js (right): https://codereview.chromium.org/1268353005/diff/460001/Source/devtools/front_end/components/EventListenersUtils.js#newcode8 Source/devtools/front_end/components/EventListenersUtils.js:8: WebInspector.PageEventListener; Still don't get which is what. https://codereview.chromium.org/1268353005/diff/460001/Source/devtools/front_end/components/EventListenersUtils.js#newcode99 Source/devtools/front_end/components/EventListenersUtils.js:99: ...
5 years, 3 months ago (2015-09-03 18:56:35 UTC) #41
pfeldman
https://codereview.chromium.org/1268353005/diff/460001/Source/devtools/front_end/components/EventListenersUtils.js File Source/devtools/front_end/components/EventListenersUtils.js (right): https://codereview.chromium.org/1268353005/diff/460001/Source/devtools/front_end/components/EventListenersUtils.js#newcode18 Source/devtools/front_end/components/EventListenersUtils.js:18: WebInspector.EventListenerRawResult; This should be entirely encapsulated into the functions ...
5 years, 3 months ago (2015-09-03 20:22:46 UTC) #42
kozy
All done in EventListenersUtils.js. Rewrited EventListenersView.js. ptal. https://codereview.chromium.org/1268353005/diff/460001/Source/devtools/front_end/components/EventListenersUtils.js File Source/devtools/front_end/components/EventListenersUtils.js (right): https://codereview.chromium.org/1268353005/diff/460001/Source/devtools/front_end/components/EventListenersUtils.js#newcode8 Source/devtools/front_end/components/EventListenersUtils.js:8: WebInspector.PageEventListener; On ...
5 years, 3 months ago (2015-09-03 22:17:25 UTC) #43
pfeldman
lgtm
5 years, 3 months ago (2015-09-03 23:35:37 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1268353005/480001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1268353005/480001
5 years, 3 months ago (2015-09-04 01:55:40 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/96457)
5 years, 3 months ago (2015-09-04 02:04:16 UTC) #49
paulirish
Should we add a test for devtoolsFrameworkEventListeners?
5 years, 3 months ago (2015-09-04 03:41:50 UTC) #50
pfeldman
Paul, you are absolutely right, I missed it.
5 years, 3 months ago (2015-09-04 04:42:55 UTC) #51
PhistucK
Just a drive-by. https://codereview.chromium.org/1268353005/diff/500001/Source/devtools/front_end/components/EventListenersUtils.js File Source/devtools/front_end/components/EventListenersUtils.js (right): https://codereview.chromium.org/1268353005/diff/500001/Source/devtools/front_end/components/EventListenersUtils.js#newcode91 Source/devtools/front_end/components/EventListenersUtils.js:91: function storeTrunkatedListener(truncatedListener) Nit - s/Trunkated/Truncated/
5 years, 3 months ago (2015-09-04 09:13:25 UTC) #53
kozy
5 years, 3 months ago (2015-09-04 17:43:53 UTC) #55
Message was sent while issue was closed.
Committed patchset #16 (id:480001) manually as 201767 (presubmit successful).

It was landed yesterday evening before comments, I'll add test and fix nit in
separated CL..

Powered by Google App Engine
This is Rietveld 408576698