Bug 93271

Summary: Web Inspector: Use and process the actual ScriptId in the protocol EventListener object
Product: WebKit Reporter: Alexander Pavlov (apavlov) <apavlov>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Severity: Normal CC: abarth, apavlov, bweinstein, haraken, japhet, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Patch yurys: review+

Description Alexander Pavlov (apavlov) 2012-08-06 07:46:39 PDT
Currently, EventListener object's "location" field transferred through the protocol contains the script URL, not the script id.
Comment 1 Alexander Pavlov (apavlov) 2012-08-06 09:44:13 PDT
Currently, it is impossible to rely on scriptId's rather than source URLs, as scripts are not registered with the frontend until the debugger is explicitly enabled by the user.
Comment 2 Alexander Pavlov (apavlov) 2012-09-18 09:02:25 PDT
Created attachment 164569 [details]
Comment 3 Vsevolod Vlasov 2012-09-20 00:20:00 PDT
Comment on attachment 164569 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=164569&action=review

> Source/WebCore/bindings/js/ScriptEventListener.cpp:109
> +bool eventListenerHandlerLocation(Document* document, EventListener* eventListener, String& sourceName, String& sourceId, int& lineNumber)


> Source/WebCore/bindings/v8/ScriptEventListener.cpp:121
> +    v8::Handle<v8::Value> scriptIdValue = function->GetScriptId();

scriptId is always available in v8.

> Source/WebCore/inspector/front-end/EventListenersSidebarPane.js:208
> +                if (this.eventListener.location.scriptId)

I don't think scriptId is valuable for user.
Comment 4 Alexander Pavlov (apavlov) 2012-09-20 00:50:58 PDT
Created attachment 164854 [details]
Comment 5 Yury Semikhatsky 2012-09-20 01:12:57 PDT
Comment on attachment 164854 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=164854&action=review

> Source/WebCore/bindings/js/ScriptEventListener.cpp:127
> +    scriptId = funcSourceId == SourceProvider::nullID ? "" : String::number(funcSourceId);

I wonder when (funcSourceId == SourceProvider::nullID) can happen.
Comment 6 Alexander Pavlov (apavlov) 2012-09-20 01:33:41 PDT
Committed r129105: <http://trac.webkit.org/changeset/129105>
Comment 7 Alexander Pavlov (apavlov) 2012-09-20 01:39:02 PDT
Chromium issue: http://code.google.com/p/chromium/issues/detail?id=140375