Bug 68827

Summary: Web Inspector: Scripts panel without folders causes errors when creating content scripts section.
Product: WebKit Reporter: Vsevolod Vlasov <vsevik>
Component: Web Inspector (Deprecated)Assignee: Vsevolod Vlasov <vsevik>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, vsevik, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch yurys: review+

Description Vsevolod Vlasov 2011-09-26 12:43:06 PDT
Scripts panel without folders causes errors when creating content scripts section.

"Uncaught TypeError: Cannot call method 'localeCompare' of undefined", source: chrome-devtools://devtools/ScriptsPanel.js (312)

optionCompare() at ScriptsPanel.js:312
binarySearch() at BinarySearch.js:39
insertionIndexForObjectInListSortedByFunction() at BinarySearch.js:60
insertOrdered() at ScriptsPanel.js:314
WebInspector.ScriptsPanel._addOptionToFilesSelect() at ScriptsPanel.js:326
WebInspector.ScriptsPanel._showScriptFoldersSettingChanged() at ScriptsPanel.js:265
bound() at utilities.js:40
WebInspector.Object.dispatchEventToListeners() at Object.js:93
WebInspector.Setting.set() at Settings.js:157
listener() at SettingsScreen.js:101
Comment 1 Vsevolod Vlasov 2011-09-26 12:55:02 PDT
Created attachment 108712 [details]
Patch
Comment 2 Vsevolod Vlasov 2011-09-26 12:56:00 PDT
Content scripts should be tested LayoutTests/inspector/debugger/scripts-sorting.html
Comment 3 Pavel Feldman 2011-09-26 14:36:31 PDT
Comment on attachment 108712 [details]
Patch

We should support content script section in both modes.
Comment 4 Vsevolod Vlasov 2011-09-26 15:09:32 PDT
Should we? They are already highlighted in blue.
Showing a separate section makes typing in file selector useless for content scripts.

Anyway, currently they are not shown at all.
Comment 5 Pavel Feldman 2011-09-27 09:15:39 PDT
Created attachment 108857 [details]
Patch
Comment 6 Vsevolod Vlasov 2011-09-27 09:56:15 PDT
Comment on attachment 108857 [details]
Patch

Looks good.
Comment 7 Yury Semikhatsky 2011-09-28 08:18:29 PDT
Comment on attachment 108857 [details]
Patch

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

> LayoutTests/inspector/debugger/scripts-sorting.html:30
> +        addOption("*Non*URL*path");

Move this string into the array.

> LayoutTests/inspector/debugger/scripts-sorting.html:37
> +        addOption("*Non*URL*path", true);

Ditto.
Comment 8 Pavel Feldman 2011-09-29 04:38:20 PDT
Committed r96319: <http://trac.webkit.org/changeset/96319>