Changeset 88808 in webkit
- Timestamp:
- Jun 14, 2011 9:25:29 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r88806 r88808 1 2011-06-14 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: add tooltip to file select options in scripts panel. 6 https://bugs.webkit.org/show_bug.cgi?id=62537 7 8 * inspector/debugger/scripts-panel-expected.txt: 9 * inspector/debugger/scripts-panel.html: 10 1 11 2011-06-14 Ademar de Souza Reis Jr. <ademar.reis@openbossa.org> 2 12 -
trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt
r79873 r88808 9 9 Running: testSourceFramesCount 10 10 Page reloaded. 11 12 Running: testFilesSelect 13 text: script.js, tooltip: ...foo/bar/script.js 14 text: script.js, tooltip: ...foo/bar/script.js?a=1 15 text: script.js, tooltip: ...foo/bar/script.js?a=2 16 text: script.js, tooltip: ...foo/baz/script.js 17 text: Content scripts, tooltip: ... 18 text: contentScript.js, tooltip: ...foo/bar/contentScript.js?a=1 19 text: contentScript.js, tooltip: ...foo/bar/contentScript.js?a=2 20 text: contentScript2.js, tooltip: ...foo/bar/contentScript2.js?a=1 11 21 Debugger was disabled. 12 22 -
trunk/LayoutTests/inspector/debugger/scripts-panel.html
r80224 r88808 123 123 next(); 124 124 } 125 }, 126 127 function testFilesSelect(next) 128 { 129 var panel = new WebInspector.ScriptsPanel(); 130 var rootURL = WebInspector.mainResource.url.substring(0, WebInspector.mainResource.url.lastIndexOf("/") + 1); 131 var nextId = 0; 132 133 function addOption(url, isContentScript) 134 { 135 var displayName = url; 136 var indexOfQuery = displayName.indexOf("?"); 137 if (indexOfQuery !== -1) 138 displayName = displayName.substring(0, indexOfQuery); 139 var lastSlashIndex = displayName.lastIndexOf("/"); 140 if (lastSlashIndex !== -1) 141 displayName = displayName.substring(lastSlashIndex + 1); 142 panel._addOptionToFilesSelect({ id: nextId++, url: rootURL + url, displayName: displayName, isContentScript: isContentScript }); 143 } 144 addOption("foo/bar/script.js", false); 145 addOption("foo/bar/contentScript2.js?a=1", true); 146 addOption("foo/bar/script.js?a=2", false); 147 addOption("foo/bar/contentScript.js?a=2", true); 148 addOption("foo/bar/script.js?a=1", false); 149 addOption("foo/baz/script.js", false); 150 addOption("foo/bar/contentScript.js?a=1", true); 151 var select = panel._filesSelectElement; 152 for (var i = 0; i < select.length; ++i) { 153 var option = select[i]; 154 var tooltip = "..." + option.title.substring(rootURL.length); 155 InspectorTest.addResult("text: " + option.text + ", tooltip: " + tooltip); 156 } 157 next(); 125 158 } 126 159 ]); -
trunk/Source/WebCore/ChangeLog
r88805 r88808 1 2011-06-14 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: add tooltip to file select options in scripts panel. 6 https://bugs.webkit.org/show_bug.cgi?id=62537 7 8 * inspector/front-end/ScriptsPanel.js: 9 (WebInspector.ScriptsPanel): 10 (WebInspector.ScriptsPanel.prototype._sourceFileAdded): 11 (WebInspector.ScriptsPanel.prototype._addOptionToFilesSelect.compare): 12 (WebInspector.ScriptsPanel.prototype._addOptionToFilesSelect): 13 (WebInspector.ScriptsPanel.prototype._callFrameSelected.didGetSourceLocation): 14 (WebInspector.ScriptsPanel.prototype._callFrameSelected): 15 1 16 2011-06-14 Luke Macpherson <macpherson@chromium.org> 2 17 -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r88805 r88808 119 119 this.sidebarPanes.scopechain.expanded = true; 120 120 this.sidebarPanes.jsBreakpoints.expanded = true; 121 121 122 122 var helpSection = WebInspector.shortcutsHelp.section(WebInspector.UIString("Scripts Panel")); 123 this.sidebarPanes.callstack.registerShortcuts(helpSection, this.registerShortcut.bind(this)); 123 this.sidebarPanes.callstack.registerShortcuts(helpSection, this.registerShortcut.bind(this)); 124 124 125 125 var panelEnablerHeading = WebInspector.UIString("You need to enable debugging before you can use the Scripts panel."); … … 235 235 } 236 236 237 this._addOptionToFilesSelect(sourceFile .id);237 this._addOptionToFilesSelect(sourceFile); 238 238 239 239 var lastViewedURL = WebInspector.settings.lastViewedScriptFile; … … 249 249 }, 250 250 251 _addOptionToFilesSelect: function(sourceFileId) 252 { 253 var sourceFile = this._presentationModel.sourceFile(sourceFileId); 251 _addOptionToFilesSelect: function(sourceFile) 252 { 254 253 var select = this._filesSelectElement; 255 254 var option = document.createElement("option"); 256 255 option.text = sourceFile.displayName; 256 option.title = sourceFile.url; 257 257 option.isContentScript = sourceFile.isContentScript; 258 258 if (sourceFile.isContentScript) 259 259 option.addStyleClass("extension-script"); 260 function compare(a, b) 261 { 262 return a < b ? -1 : (a > b ? 1 : 0); 263 } 260 264 function optionCompare(a, b) 261 265 { … … 270 274 return -1; 271 275 272 if (a.text === b.text) 273 return 0; 274 return a.text < b.text ? -1 : 1; 276 return compare(a.text, b.text) || compare(a.title, b.title); 275 277 } 276 278 … … 287 289 select.insertBefore(contentScriptSection, insertionIndex < 0 ? null : select.childNodes.item(insertionIndex)); 288 290 } 289 option._sourceFileId = sourceFile Id;290 this._sourceFileIdToFilesSelectOption[sourceFile Id] = option;291 option._sourceFileId = sourceFile.id; 292 this._sourceFileIdToFilesSelectOption[sourceFile.id] = option; 291 293 }, 292 294 … … 649 651 if (!(sourceFileId in this._sourceFileIdToFilesSelectOption)) { 650 652 // Anonymous scripts are not added to files select by default. 651 this._addOptionToFilesSelect(sourceFileId); 653 var sourceFile = this._presentationModel.sourceFile(sourceFileId); 654 this._addOptionToFilesSelect(sourceFile); 652 655 } 653 656 var sourceFrame = this._showSourceFrameAndAddToHistory(sourceFileId);
Note: See TracChangeset
for help on using the changeset viewer.