Bug 59717

Summary: Web Inspector: include script end line:column in scriptParsed parameters.
Product: WebKit Reporter: Pavel Podivilov <podivilov>
Component: Web Inspector (Deprecated)Assignee: Pavel Podivilov <podivilov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch yurys: review+

Description Pavel Podivilov 2011-04-28 11:28:07 PDT
Web Inspector: include script end location in scriptParsed parameters.

This is needed to detect script boundaries when editing scripts inlined in html.
Comment 1 Pavel Podivilov 2011-04-28 11:32:09 PDT
Created attachment 91525 [details]
Patch
Comment 2 Yury Semikhatsky 2011-04-29 05:01:45 PDT
Comment on attachment 91525 [details]
Patch

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

> Source/WebCore/bindings/v8/DebuggerScript.js:96
> +        endColumn = script.source.length - (script.line_ends[lineCount - 2] + 1);

Do we really need this +1?

> Source/WebCore/inspector/InspectorDebuggerAgent.h:123
> +    virtual void didParseSource(const String& sourceID, const String& url, const String& data,  int startLine, int startColumn, int endLine, int endColumn, bool isContentScript);

Remove extra space before int startLine.
Comment 3 Pavel Podivilov 2011-04-29 05:15:35 PDT
(In reply to comment #2)
> (From update of attachment 91525 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=91525&action=review
> 
> > Source/WebCore/bindings/v8/DebuggerScript.js:96
> > +        endColumn = script.source.length - (script.line_ends[lineCount - 2] + 1);
> 
> Do we really need this +1?

<script>
var x
</script>

Here length = 7, line_ends = [0, 6], endLine = 1, endColumn = 6.

Without this +1, endColumn would be 7, which is incorrect.
Comment 4 Pavel Podivilov 2011-04-29 06:10:11 PDT
Committed r85320: <http://trac.webkit.org/changeset/85320>