Changeset 88936 in webkit
- Timestamp:
- Jun 15, 2011 8:17:57 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r88934 r88936 1 2011-06-15 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: script select can be too wide. 6 https://bugs.webkit.org/show_bug.cgi?id=62701 7 8 * inspector/debugger/scripts-panel-expected.txt: 9 * inspector/debugger/scripts-panel.html: 10 1 11 2011-06-15 Noel Gordon <noel.gordon@gmail.com> 2 12 -
trunk/LayoutTests/inspector/debugger/scripts-panel-expected.txt
r88931 r88936 11 11 12 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 13 text: ?a=b, tooltip: ?a=b 14 text: example.com/, tooltip: http://example.com/?a=b 15 text: script.js, tooltip: <root>/foo/bar/script.js 16 text: script.js, tooltip: <root>/foo/bar/script.js?a=1 17 text: script.js, tooltip: <root>/foo/bar/script.js?a=2 18 text: script.js, tooltip: <root>/foo/baz/script.js 19 text: very_loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo..., tooltip: very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url 20 text: Content scripts, tooltip: 21 text: contentScript.js, tooltip: <root>/foo/bar/contentScript.js?a=1 22 text: contentScript.js, tooltip: <root>/foo/bar/contentScript.js?a=2 23 text: contentScript2.js, tooltip: <root>/foo/bar/contentScript2.js?a=1 21 24 Debugger was disabled. 22 25 -
trunk/LayoutTests/inspector/debugger/scripts-panel.html
r88931 r88936 130 130 var rootURL = WebInspector.mainResource.url.substring(0, WebInspector.mainResource.url.lastIndexOf("/") + 1); 131 131 var nextId = 0; 132 133 132 function addOption(url, isContentScript) 134 133 { 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 }); 134 panel._addOptionToFilesSelect({ id: nextId++, url: url, isContentScript: isContentScript }); 143 135 } 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); 136 addOption(rootURL + "foo/bar/script.js", false); 137 addOption(rootURL + "foo/bar/contentScript2.js?a=1", true); 138 addOption(rootURL + "foo/bar/script.js?a=2", false); 139 addOption(rootURL + "foo/bar/contentScript.js?a=2", true); 140 addOption(rootURL + "foo/bar/script.js?a=1", false); 141 addOption(rootURL + "foo/baz/script.js", false); 142 addOption(rootURL + "foo/bar/contentScript.js?a=1", true); 143 addOption("http://example.com/?a=b", false); 144 addOption("?a=b", false); 145 addOption("very_looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong_url", false); 146 151 147 var select = panel._filesSelectElement; 152 148 for (var i = 0; i < select.length; ++i) { 153 149 var option = select[i]; 154 var tooltip = "..." + option.title.substring(rootURL.length);150 var tooltip = option.title.replace(rootURL, "<root>/"); 155 151 InspectorTest.addResult("text: " + option.text + ", tooltip: " + tooltip); 156 152 } -
trunk/Source/WebCore/ChangeLog
r88934 r88936 1 2011-06-15 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: script select can be too wide. 6 https://bugs.webkit.org/show_bug.cgi?id=62701 7 8 * inspector/front-end/ScriptsPanel.js: 9 (WebInspector.ScriptsPanel.prototype._displayNameForScriptURL): 10 (WebInspector.ScriptsPanel.prototype._createSourceFrame): 11 (WebInspector.SourceFrameDelegateForScriptsPanel): 12 (WebInspector.SourceFrameDelegateForScriptsPanel.prototype.suggestedFileName): 13 * inspector/front-end/SourceFile.js: 14 1 15 2011-06-15 Noel Gordon <noel.gordon@gmail.com> 2 16 -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r88931 r88936 253 253 var select = this._filesSelectElement; 254 254 var option = document.createElement("option"); 255 option.text = sourceFile.displayName;255 option.text = this._displayNameForScriptURL(sourceFile.url) || WebInspector.UIString("(program)"); 256 256 option.title = sourceFile.url; 257 257 option.isContentScript = sourceFile.isContentScript; … … 291 291 option._sourceFileId = sourceFile.id; 292 292 this._sourceFileIdToFilesSelectOption[sourceFile.id] = option; 293 }, 294 295 _displayNameForScriptURL: function(url) 296 { 297 var displayName = url; 298 var indexOfQuery = displayName.indexOf("?"); 299 if (indexOfQuery > 0) 300 displayName = displayName.substring(0, indexOfQuery); 301 var fromIndex = displayName.lastIndexOf("/", displayName.length - 2); 302 if (fromIndex !== -1) 303 displayName = displayName.substring(fromIndex + 1); 304 if (displayName.length > 100) 305 displayName = displayName.substring(0, 80) + "..."; 306 return displayName; 293 307 }, 294 308 … … 591 605 { 592 606 var sourceFile = this._presentationModel.sourceFile(sourceFileId); 593 var delegate = new WebInspector.SourceFrameDelegateForScriptsPanel(this._presentationModel, sourceFileId , sourceFile.displayName);607 var delegate = new WebInspector.SourceFrameDelegateForScriptsPanel(this._presentationModel, sourceFileId); 594 608 var sourceFrame = new WebInspector.SourceFrame(delegate, sourceFile.url); 595 609 sourceFrame._sourceFileId = sourceFileId; … … 1056 1070 1057 1071 1058 WebInspector.SourceFrameDelegateForScriptsPanel = function(model, sourceFileId , scriptName)1072 WebInspector.SourceFrameDelegateForScriptsPanel = function(model, sourceFileId) 1059 1073 { 1060 1074 WebInspector.SourceFrameDelegate.call(this); … … 1062 1076 this._sourceFileId = sourceFileId; 1063 1077 this._popoverObjectGroup = "popover"; 1064 this._scriptName = scriptName;1065 1078 } 1066 1079 … … 1136 1149 suggestedFileName: function() 1137 1150 { 1138 return this._scriptName; 1151 var sourceFile = this._model.sourceFile(this._sourceFileId); 1152 return WebInspector.panels.scripts._displayNameForScriptURL(sourceFile.url) || "untitled.js"; 1139 1153 } 1140 1154 } -
trunk/Source/WebCore/inspector/front-end/SourceFile.js
r88931 r88936 64 64 }, 65 65 66 get displayName()67 {68 return this.url ? WebInspector.displayNameForURL(this.url) : WebInspector.UIString("(program)");69 },70 71 66 get content() 72 67 {
Note: See TracChangeset
for help on using the changeset viewer.