Bug 68526 - Web Inspector: RawSourceCode could be mapped to several UISourceCodes.
Summary: Web Inspector: RawSourceCode could be mapped to several UISourceCodes.
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-09-21 06:31 PDT by Pavel Podivilov
Modified: 2011-10-10 09:08 PDT (History)
10 users (show)

See Also:


Attachments
Patch. (15.69 KB, patch)
2011-09-21 06:35 PDT, Pavel Podivilov
no flags Details | Formatted Diff | Diff
Patch (22.58 KB, patch)
2011-09-28 08:51 PDT, Pavel Podivilov
no flags Details | Formatted Diff | Diff
Patch (20.24 KB, patch)
2011-09-28 08:58 PDT, Pavel Podivilov
pfeldman: 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-09-21 06:31:36 PDT
Web Inspector: RawSourceCode could be mapped to several UISourceCodes.

Replace SourceMapping.uiSourceCode with SourceMapping.uiSourceCodeList as there could be more then one UISourceCode associated with a RawSourceCode.
Comment 1 Pavel Podivilov 2011-09-21 06:35:40 PDT
Created attachment 108143 [details]
Patch.

Based on patch attached to https://bugs.webkit.org/show_bug.cgi?id=68524.
Comment 2 Yury Semikhatsky 2011-09-23 03:50:59 PDT
Comment on attachment 108143 [details]
Patch.

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

> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:134
> +            // FIXME: uiSourceCodeList may contain more then one entry.

What prevents you from iterating though all uiSourceCodeList elements in this change?

> Source/WebCore/inspector/front-end/SourceFile.js:205
> +        return [this._uiSourceCode];

Why not keep this list in a field to avoid creating it on each call?
Comment 3 Pavel Podivilov 2011-09-28 08:51:13 PDT
Created attachment 109025 [details]
Patch
Comment 4 Pavel Podivilov 2011-09-28 08:53:33 PDT
(In reply to comment #2)
> (From update of attachment 108143 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=108143&action=review
> 
> > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:134
> > +            // FIXME: uiSourceCodeList may contain more then one entry.
> 
> What prevents you from iterating though all uiSourceCodeList elements in this change?

Removed those fixmes, but added one in ScriptsPanel._uiSourceCodeReplaced to keep patch size small.

> 
> > Source/WebCore/inspector/front-end/SourceFile.js:205
> > +        return [this._uiSourceCode];
> 
> Why not keep this list in a field to avoid creating it on each call?

Done.
Comment 5 Pavel Podivilov 2011-09-28 08:58:24 PDT
Created attachment 109027 [details]
Patch
Comment 6 Pavel Feldman 2011-09-28 22:46:14 PDT
Comment on attachment 109027 [details]
Patch

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

> LayoutTests/inspector/debugger/raw-source-code.html:106
>              var rawSourceCode = createRawSourceCode(script, null);

You probably need a new test for this functionality.

> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:462
> +        var uiLocation = this._rawSourceCode.sourceMapping.rawLocationToUILocation(this._callFrame.location);

Again, use rawLocationToUILocation. I don't get your FIXME in the RawSourceCode suggesting the opposite. Are you expecting RawSourceCode to lose this._sourceMapping member?
Comment 7 Pavel Podivilov 2011-09-29 02:16:39 PDT
(In reply to comment #6)
> (From update of attachment 109027 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=109027&action=review
> 
> > LayoutTests/inspector/debugger/raw-source-code.html:106
> >              var rawSourceCode = createRawSourceCode(script, null);
> 
> You probably need a new test for this functionality.

There is no new functionality it this change, it's just a refactoring. Let me put all the pieces together and add integration tests for compiler source maps.

> 
> > Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:462
> > +        var uiLocation = this._rawSourceCode.sourceMapping.rawLocationToUILocation(this._callFrame.location);
> 
> Again, use rawLocationToUILocation. I don't get your FIXME in the RawSourceCode suggesting the opposite. Are you expecting RawSourceCode to lose this._sourceMapping member?

FIXME in the RawSourceCode suggests that conversion methods should be a part of SourceMapping interface because sometimes RawSourceCode don't have source mapping right after creation (e.g. formatting is in progress).
Comment 8 Pavel Feldman 2011-09-30 04:47:43 PDT
Comment on attachment 109027 [details]
Patch

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

>>> Source/WebCore/inspector/front-end/DebuggerPresentationModel.js:462
>>> +        var uiLocation = this._rawSourceCode.sourceMapping.rawLocationToUILocation(this._callFrame.location);
>> 
>> Again, use rawLocationToUILocation. I don't get your FIXME in the RawSourceCode suggesting the opposite. Are you expecting RawSourceCode to lose this._sourceMapping member?
> 
> FIXME in the RawSourceCode suggests that conversion methods should be a part of SourceMapping interface because sometimes RawSourceCode don't have source mapping right after creation (e.g. formatting is in progress).

Please add FIXME suggesting doing rawSourceCode.toUILocation()
Comment 9 Pavel Podivilov 2011-10-10 09:08:46 PDT
Committed r97063: <http://trac.webkit.org/changeset/97063>