Bug 52377 - Web Inspector: provide script column offset to frontend
Summary: Web Inspector: provide script column offset to frontend
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-01-13 10:22 PST by Pavel Podivilov
Modified: 2011-01-14 07:50 PST (History)
10 users (show)

See Also:


Attachments
Patch. (13.16 KB, patch)
2011-01-13 10:24 PST, Pavel Podivilov
yurys: review-
yurys: commit-queue-
Details | Formatted Diff | Diff
Comments addressed. (12.96 KB, patch)
2011-01-14 05:11 PST, 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-01-13 10:22:57 PST
Web Inspector: provide script column offset to frontend. This is needed for script beautification and live edit in HTML.
Comment 1 Pavel Podivilov 2011-01-13 10:24:33 PST
Created attachment 78825 [details]
Patch.
Comment 2 Yury Semikhatsky 2011-01-14 03:02:40 PST
Comment on attachment 78825 [details]
Patch.

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

> Source/JavaScriptCore/parser/SourceCode.h:33
> +#include <wtf/text/TextPosition.h>

Mind alphabetical order.

> Source/JavaScriptCore/parser/SourceCode.h:54
> +            , m_columnOffset(0)

Why not pass column as additional parameter?

> Source/JavaScriptCore/parser/SourceCode.h:63
> +            , m_columnOffset(0)

Why not pass column as additional parameter?

> Source/JavaScriptCore/parser/SourceCode.h:88
> +        int lineOffset() const { return m_lineOffset; }

There should be only one of firstLine/lineOffset. Also offset is already used as a linear position in the source string and using the same term for line/column might confuse people.
Comment 3 Pavel Podivilov 2011-01-14 05:11:09 PST
Created attachment 78928 [details]
Comments addressed.
Comment 4 Yury Semikhatsky 2011-01-14 06:23:18 PST
Comment on attachment 78928 [details]
Comments addressed.

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

> Source/WebCore/inspector/front-end/Script.js:31
> +    this.lineOffset = lineOffset;

Consider using the same names as in SourceCode.h for consistency.

> Source/WebCore/inspector/front-end/Script.js:36
> +    this.startingLine = lineOffset + 1;

Please remove this field and use only lineOffset, clients should add 1 when needed.
Comment 5 Pavel Podivilov 2011-01-14 07:50:06 PST
Committed r75794: <http://trac.webkit.org/changeset/75794>