Bug 59717 - Web Inspector: include script end line:column in scriptParsed parameters.
Summary: Web Inspector: include script end line:column in scriptParsed parameters.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Podivilov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-28 11:28 PDT by Pavel Podivilov
Modified: 2011-04-29 06:10 PDT (History)
10 users (show)

See Also:


Attachments
Patch (18.53 KB, patch)
2011-04-28 11:32 PDT, Pavel Podivilov
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>