Changeset 103541 in webkit
- Timestamp:
- Dec 22, 2011 7:19:40 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r103539 r103541 1 2011-12-22 Pavel Podivilov <podivilov@chromium.org> 2 3 Web Inspector: add "install source map" to JS source frame context menu. 4 https://bugs.webkit.org/show_bug.cgi?id=74181 5 6 Reviewed by Pavel Feldman. 7 8 * http/tests/inspector/compiler-source-mapping-debug.html: 9 * http/tests/inspector/compiler-source-mapping.html: 10 * inspector/debugger/scripts-panel.html: 11 * inspector/debugger/scripts-sorting.html: 12 * inspector/debugger/ui-source-code.html: 13 1 14 2011-12-22 Branimir Lambov <blambov@google.com> 2 15 -
trunk/LayoutTests/http/tests/inspector/compiler-source-mapping-debug.html
r101128 r103541 14 14 function test() 15 15 { 16 17 16 InspectorTest.runDebuggerTestSuite([ 18 17 function testSetBreakpoint(next) … … 23 22 { 24 23 InspectorTest.addResult("Script source was shown."); 25 sourceFrame._model.setCompilerSourceMapping(sourceFrame._uiSourceCode, "http://localhost:8000/inspector/resources/source-map.json"); 24 sourceFrame._uiSourceCode.sourceMapURL = "http://localhost:8000/inspector/resources/source-map.json"; 25 sourceFrame._model.installCompilerSourceMapping(sourceFrame._uiSourceCode); 26 26 InspectorTest.showScriptSource("source1.js", didShowSource1); 27 28 27 } 29 28 -
trunk/LayoutTests/http/tests/inspector/compiler-source-mapping.html
r103534 r103541 95 95 var mappingPayload = { 96 96 "sections": [{ 97 "offset": { "line": 1, "column": 0 },97 "offset": { "line": 0, "column": 0 }, 98 98 "map": { 99 99 "mappings":"AAAA,CAEC", … … 101 101 } 102 102 }, { 103 "offset": { "line": 3, "column": 10 },103 "offset": { "line": 2, "column": 10 }, 104 104 "map": { 105 105 "mappings":"AAAA,CAEC", -
trunk/LayoutTests/inspector/debugger/scripts-panel.html
r102671 r103541 20 20 function createUISouceCode(url) 21 21 { 22 var uiSourceCode = new WebInspector.UISourceCode(0, url, false,null, null);22 var uiSourceCode = new WebInspector.UISourceCode(0, url, null, null); 23 23 uiSourceCode.requestContent = function(callback) 24 24 { … … 137 137 function addOption(url, isContentScript) 138 138 { 139 panel._addOptionToFilesSelect(new WebInspector.UISourceCode(nextId++, url, isContentScript, null, null)); 139 var uiSourceCode = new WebInspector.UISourceCode(nextId++, url, null, null); 140 uiSourceCode.isContentScript = isContentScript; 141 panel._addOptionToFilesSelect(uiSourceCode); 140 142 } 141 143 addOption(rootURL + "foo/bar/script.js", false); -
trunk/LayoutTests/inspector/debugger/scripts-sorting.html
r102671 r103541 58 58 function addOption(url, isContentScript) 59 59 { 60 WebInspector.panels.scripts._addOptionToFilesSelect(new WebInspector.UISourceCode(nextId++, url, isContentScript, null, null)); 60 var uiSourceCode = new WebInspector.UISourceCode(nextId++, url, null, null); 61 uiSourceCode.isContentScript = isContentScript; 62 WebInspector.panels.scripts._addOptionToFilesSelect(uiSourceCode); 61 63 } 62 64 -
trunk/LayoutTests/inspector/debugger/ui-source-code.html
r93969 r103541 18 18 function testUISourceCode(next) 19 19 { 20 var uiSourceCode = new WebInspector.UISourceCode("id", "url", false,null, contentProvider);20 var uiSourceCode = new WebInspector.UISourceCode("id", "url", null, contentProvider); 21 21 function didRequestContent(callNumber, mimeType, content) 22 22 { -
trunk/Source/WebCore/ChangeLog
r103539 r103541 1 2011-12-22 Pavel Podivilov <podivilov@chromium.org> 2 3 Web Inspector: add "install source map" to JS source frame context menu. 4 https://bugs.webkit.org/show_bug.cgi?id=74181 5 6 Reviewed by Pavel Feldman. 7 8 Add "install source map" to source frame context menu when source map url is auto detected. 9 10 * English.lproj/localizedStrings.js: 11 * inspector/front-end/CompilerSourceMapping.js: 12 (WebInspector.ClosureCompilerSourceMapping.prototype.load): 13 (WebInspector.ClosureCompilerSourceMapping.prototype._parseSections): 14 * inspector/front-end/DebuggerPresentationModel.js: 15 (WebInspector.DebuggerPresentationModel.prototype.installCompilerSourceMapping): 16 * inspector/front-end/JavaScriptSourceFrame.js: 17 (WebInspector.JavaScriptSourceFrame.prototype.populateTextAreaContextMenu): 18 (WebInspector.JavaScriptSourceFrame.prototype.cancelEditing): 19 * inspector/front-end/RawSourceCode.js: 20 (WebInspector.RawSourceCode.prototype._createSourceMapping.didRequestContent.didFormatContent): 21 (WebInspector.RawSourceCode.prototype._createSourceMapping.didRequestContent): 22 (WebInspector.RawSourceCode.prototype._createSourceMapping): 23 (WebInspector.RawSourceCode.prototype._createUISourceCode): 24 * inspector/front-end/UISourceCode.js: 25 (WebInspector.UISourceCode): 26 1 27 2011-12-22 Branimir Lambov <blambov@google.com> 2 28 -
trunk/Source/WebCore/inspector/front-end/CompilerSourceMapping.js
r103534 r103541 98 98 // FIXME: make sendRequest async. 99 99 var response = InspectorFrontendHost.loadResourceSynchronously(this._sourceMappingURL); 100 if (response.slice(0, 3) === ")]}") 101 response = response.substring(response.indexOf('\n')); 100 102 this._parseMappingPayload(JSON.parse(response)); 101 103 return true … … 183 185 for (var i = 0; i < sections.length; ++i) { 184 186 var section = sections[i]; 185 this._parseMap(section.map, section.offset.line - 1, section.offset.column)187 this._parseMap(section.map, section.offset.line, section.offset.column) 186 188 } 187 189 }, -
trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
r103534 r103541 338 338 /** 339 339 * @param {WebInspector.UISourceCode} uiSourceCode 340 * @param {string} sourceMappingURL 341 */ 342 setCompilerSourceMapping: function(uiSourceCode, sourceMappingURL) 343 { 344 var sourceMapping = new WebInspector.ClosureCompilerSourceMapping(sourceMappingURL, uiSourceCode.url); 340 */ 341 installCompilerSourceMapping: function(uiSourceCode) 342 { 343 var sourceMapping = new WebInspector.ClosureCompilerSourceMapping(uiSourceCode.sourceMapURL, uiSourceCode.url); 345 344 uiSourceCode.rawSourceCode.setCompilerSourceMapping(sourceMapping); 346 345 }, -
trunk/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
r102671 r103541 148 148 WebInspector.SourceFrame.prototype.populateTextAreaContextMenu.call(this, contextMenu, lineNumber); 149 149 var selection = window.getSelection(); 150 if (selection.type !== "Range" || selection.isCollapsed) 151 return; 152 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Add to watch" : "Add to Watch"), 153 this._scriptsPanel.addToWatch.bind(this._scriptsPanel, selection.toString())); 154 155 contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Evaluate in console" : "Evaluate in Console"), WebInspector.evaluateInConsole.bind(WebInspector, selection.toString())); 150 if (selection.type === "Range" && !selection.isCollapsed) { 151 var addToWatchLabel = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Add to watch" : "Add to Watch"); 152 contextMenu.appendItem(addToWatchLabel, this._scriptsPanel.addToWatch.bind(this._scriptsPanel, selection.toString())); 153 var evaluateLabel = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Evaluate in console" : "Evaluate in Console"); 154 contextMenu.appendItem(evaluateLabel, WebInspector.evaluateInConsole.bind(WebInspector, selection.toString())); 155 contextMenu.appendSeparator(); 156 } 157 158 if (this._uiSourceCode.sourceMapURL) { 159 var installSourceMapLabel = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Install source map" : "Install Source Map"); 160 contextMenu.appendItem(installSourceMapLabel, this._model.installCompilerSourceMapping.bind(this._model, this._uiSourceCode)); 161 } 162 156 163 }, 157 164 … … 199 206 { 200 207 WebInspector.SourceFrame.prototype.cancelEditing.call(this); 201 208 202 209 if (!this._javaScriptSourceFrameState) 203 210 return; -
trunk/Source/WebCore/inspector/front-end/RawSourceCode.js
r103532 r103541 196 196 var sourceURL = sourceURLs[i]; 197 197 var contentProvider = new WebInspector.CompilerSourceMappingContentProvider(sourceURL, this._compilerSourceMapping); 198 var uiSourceCode = new WebInspector.UISourceCode(sourceURL, sourceURL, this.isContentScript, this, contentProvider);198 var uiSourceCode = this._createUISourceCode(sourceURL, sourceURL, contentProvider); 199 199 uiSourceCodeList.push(uiSourceCode); 200 200 } … … 206 206 var originalContentProvider = this._createContentProvider(); 207 207 if (!this._formatted) { 208 var uiSourceCode = new WebInspector.UISourceCode(this.url, this.url, this.isContentScript, this, originalContentProvider);208 var uiSourceCode = this._createUISourceCode(this.url, this.url, originalContentProvider); 209 209 var sourceMapping = new WebInspector.RawSourceCode.PlainSourceMapping(this, uiSourceCode); 210 210 callback(sourceMapping); … … 227 227 { 228 228 var contentProvider = new WebInspector.StaticContentProvider(mimeType, formattedContent) 229 var uiSourceCode = new WebInspector.UISourceCode("deobfuscated:" + this.url, this.url, this.isContentScript, this, contentProvider);229 var uiSourceCode = this._createUISourceCode("deobfuscated:" + this.url, this.url, contentProvider); 230 230 var sourceMapping = new WebInspector.RawSourceCode.FormattedSourceMapping(this, uiSourceCode, mapping); 231 231 callback(sourceMapping); … … 234 234 } 235 235 originalContentProvider.requestContent(didRequestContent.bind(this)); 236 }, 237 238 /** 239 * @param {string} id 240 * @param {string} url 241 * @param {WebInspector.ContentProvider} contentProvider 242 */ 243 _createUISourceCode: function(id, url, contentProvider) 244 { 245 var uiSourceCode = new WebInspector.UISourceCode(id, url, this, contentProvider); 246 uiSourceCode.isContentScript = this.isContentScript; 247 uiSourceCode.sourceMapURL = this.sourceMapURL; 248 return uiSourceCode; 236 249 }, 237 250 -
trunk/Source/WebCore/inspector/front-end/UISourceCode.js
r102671 r103541 34 34 * @param {string} id 35 35 * @param {string} url 36 * @param {boolean} isContentScript37 36 * @param {WebInspector.RawSourceCode} rawSourceCode 38 37 * @param {WebInspector.ContentProvider} contentProvider 39 38 */ 40 WebInspector.UISourceCode = function(id, url, isContentScript,rawSourceCode, contentProvider)39 WebInspector.UISourceCode = function(id, url, rawSourceCode, contentProvider) 41 40 { 42 41 this._id = id; 43 42 this._url = url; 44 this._isContentScript = isContentScript;45 43 this._rawSourceCode = rawSourceCode; 46 44 this._contentProvider = contentProvider; 45 this.isContentScript = false; 46 this.sourceMapURL = ""; 47 47 /** 48 48 * @type Array.<function(string,string)> … … 70 70 { 71 71 return this._url; 72 },73 74 /**75 * @return {boolean}76 */77 get isContentScript()78 {79 return this._isContentScript;80 72 }, 81 73
Note: See TracChangeset
for help on using the changeset viewer.