Bug 109284

Summary: Web Inspector: for event listener provide handler function value in protocol and in UI
Product: WebKit Reporter: Peter Rybin <prybin>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, apavlov, dglazkov, graouts, haraken, japhet, joepeck, keishi, loislo, pfeldman, pmuellr, timothy, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Peter Rybin
Reported 2013-02-08 04:18:18 PST
Event listener handler is typically a JavaScript function. A direct display of the function value is missing. Function value should be expandable as any JavaScript value. This allows to see closure variables and function-as-object properties.
Attachments
Patch (20.98 KB, patch)
2013-02-08 05:08 PST, Peter Rybin
no flags
Patch (22.28 KB, patch)
2013-02-11 09:58 PST, Peter Rybin
no flags
Patch (23.39 KB, patch)
2013-02-11 12:59 PST, Peter Rybin
no flags
Patch (23.40 KB, patch)
2013-02-12 07:08 PST, Peter Rybin
no flags
Peter Rybin
Comment 1 2013-02-08 05:08:42 PST
Yury Semikhatsky
Comment 2 2013-02-08 05:31:59 PST
Comment on attachment 187293 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=187293&action=review > Source/WebCore/bindings/v8/ScriptEventListener.cpp:112 > + V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(listener); Please extract common part with eventListenerHandlerBody into a separate function. > Source/WebCore/inspector/Inspector.json:1748 > + { "name": "handler", "$ref": "Runtime.RemoteObject", "optional": true, "hidden": true, "description": "Event handler function value" } The type is already hidden. > Source/WebCore/inspector/Inspector.json:1870 > + { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name for handler value." } Please add a note on that handler won't be returned if the group is not specified. > Source/WebCore/inspector/InspectorDOMAgent.cpp:1394 > + InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(mainWorldScriptState(frame)); You should use the world from event listener instead. > Source/WebCore/inspector/front-end/EventListenersSidebarPane.js:123 > + node.eventListeners("arabypaC", callback); Please use WebInspector.EventListenersSidebarPane._objectGroupName
Peter Rybin
Comment 3 2013-02-11 09:58:19 PST
WebKit Review Bot
Comment 4 2013-02-11 11:37:05 PST
Comment on attachment 187603 [details] Patch Attachment 187603 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/16491317 New failing tests: inspector/elements/event-listeners-about-blank.html
Peter Rybin
Comment 5 2013-02-11 12:31:44 PST
> > Source/WebCore/bindings/v8/ScriptEventListener.cpp:112 > > + V8AbstractEventListener* v8Listener = static_cast<V8AbstractEventListener*>(listener); > Please extract common part with eventListenerHandlerBody into a separate function. Cannot do this thing. It turned out that final toWebCoreStringWithNullCheck statement depends on contextScope and breaks if the object doesn't exist. > > Source/WebCore/inspector/Inspector.json:1748 > > + { "name": "handler", "$ref": "Runtime.RemoteObject", "optional": true, "hidden": true, "description": "Event handler function value" } > The type is already hidden. Done > > Source/WebCore/inspector/Inspector.json:1870 > > + { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name for handler value." } > Please add a note on that handler won't be returned if the group is not specified. Done > > Source/WebCore/inspector/InspectorDOMAgent.cpp:1394 > > + InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(mainWorldScriptState(frame)); > You should use the world from event listener instead. Done > > Source/WebCore/inspector/front-end/EventListenersSidebarPane.js:123 > > + node.eventListeners("arabypaC", callback); > Please use WebInspector.EventListenersSidebarPane._objectGroupName Done
WebKit Review Bot
Comment 6 2013-02-11 12:39:48 PST
Comment on attachment 187603 [details] Patch Attachment 187603 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/16494309 New failing tests: inspector/elements/event-listeners-about-blank.html
Peter Rybin
Comment 7 2013-02-11 12:59:31 PST
Yury Semikhatsky
Comment 8 2013-02-12 01:37:28 PST
Comment on attachment 187641 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=187641&action=review > Source/WebCore/inspector/Inspector.json:1759 > + { "name": "handler", "$ref": "Runtime.RemoteObject", "optional": true, "description": "Event handler function value" } Missing . at the end of the sentence. > Source/WebCore/inspector/InspectorDOMAgent.h:134 > + virtual void getEventListenersForNode(ErrorString*, int nodeId, const WTF::String*, RefPtr<TypeBuilder::Array<TypeBuilder::DOM::EventListener> >& listenersArray); Param name would make sense here, otherwise it is hard to guess that the string param is objectGroupId
Peter Rybin
Comment 9 2013-02-12 07:08:03 PST
WebKit Review Bot
Comment 10 2013-02-12 08:03:07 PST
Comment on attachment 187863 [details] Patch Clearing flags on attachment: 187863 Committed r142627: <http://trac.webkit.org/changeset/142627>
WebKit Review Bot
Comment 11 2013-02-12 08:03:12 PST
All reviewed patches have been landed. Closing bug.
Peter Rybin
Comment 12 2013-03-15 14:10:00 PDT
See duplicate bug with some context: https://bugs.webkit.org/show_bug.cgi?id=107289
Note You need to log in before you can comment on or make changes to this bug.