Bug 75173 - Web Inspector: Extract FileSelector from ScriptsPanel.
Summary: Web Inspector: Extract FileSelector from ScriptsPanel.
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: Vsevolod Vlasov
URL:
Keywords:
Depends on:
Blocks: 75093
  Show dependency treegraph
 
Reported: 2011-12-23 08:07 PST by Vsevolod Vlasov
Modified: 2011-12-26 06:30 PST (History)
10 users (show)

See Also:


Attachments
Patch (61.42 KB, patch)
2011-12-23 08:32 PST, Vsevolod Vlasov
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Vlasov 2011-12-23 08:07:50 PST
Extract FileSelector from ScriptsPanel.
Comment 1 Vsevolod Vlasov 2011-12-23 08:32:48 PST
Created attachment 120468 [details]
Patch
Comment 2 Pavel Feldman 2011-12-24 01:36:37 PST
Comment on attachment 120468 [details]
Patch

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

> Source/WebCore/inspector/front-end/ScriptsPanel.js:174
> +    this._sourceFramesByUISourceCodes = new Map();

this._sourceFramesByUISourceCode (not plural)

> Source/WebCore/inspector/front-end/ScriptsPanel.js:264
> +        uiSourceCodes = this._sourceFramesByUISourceCodes;

var uiSourceCode (please run compiler)

> Source/WebCore/inspector/front-end/ScriptsPanel.js:487
> +        this._sourceFramesByUISourceCodes.put(uiSourceCode, sourceFrame)

missing ;

> Source/WebCore/inspector/front-end/ScriptsPanel.js:-654
> -        if (this._navigator)

no delegation to the file selector here. why?

> Source/WebCore/inspector/front-end/ScriptsPanel.js:-733
> -            // FIXME: We should always add anonymous scripts to navigator (in a separate folder tree element)

This fixme should probably stay.

> Source/WebCore/inspector/front-end/ScriptsPanel.js:974
> +    get defaultFocusedElement() { },

long term it should be get view()?

> Source/WebCore/inspector/front-end/ScriptsPanel.js:979
> +    show: function(element) { },

Open comment: Imagine that we end up leaving both: simple file selector and navigator panel. You will then need to delegate editor layout to that component. As a result, you no longer need to expose show / defaultFocusedElement at all.

> Source/WebCore/inspector/front-end/ScriptsPanel.js:995
> +    setScriptSourceIsBeingEdited: function(uiSourceCode, inEditMode) { },

You rather need a "dirty" marker, not inEditMode.

> Source/WebCore/inspector/front-end/ScriptsPanel.js:1001
> +    replaceUISourceCodes: function(oldUISourceCodeList, uiSourceCodeList) { },

trailing coma

> Source/WebCore/inspector/front-end/ScriptsPanel.js:1022
> +WebInspector.ScriptsPanel.SimpleFileSelector.prototype = {

ComboBoxFileSelector or DropBoxFileSelector?
Comment 3 Vsevolod Vlasov 2011-12-26 02:28:30 PST
Comment on attachment 120468 [details]
Patch

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

>> Source/WebCore/inspector/front-end/ScriptsPanel.js:-654
>> -        if (this._navigator)
> 
> no delegation to the file selector here. why?

This method is only called from _uiSourceCodeReplaced which makes all necessary delegations to file selector.

>> Source/WebCore/inspector/front-end/ScriptsPanel.js:-733
>> -            // FIXME: We should always add anonymous scripts to navigator (in a separate folder tree element)
> 
> This fixme should probably stay.

We now add all scripts to script navigator. I added a FIXME there to create a separate section fro anonymous scripts though.

>> Source/WebCore/inspector/front-end/ScriptsPanel.js:995
>> +    setScriptSourceIsBeingEdited: function(uiSourceCode, inEditMode) { },
> 
> You rather need a "dirty" marker, not inEditMode.

I'll take care of that separately.
Comment 4 Vsevolod Vlasov 2011-12-26 06:30:50 PST
Committed r103683: <http://trac.webkit.org/changeset/103683>