Changeset 96604 in webkit
- Timestamp:
- Oct 4, 2011 10:19:04 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r96599 r96604 1 2011-10-04 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: make SourceFrame compile. 4 https://bugs.webkit.org/show_bug.cgi?id=69345 5 6 Reviewed by Yury Semikhatsky. 7 8 * inspector/compile-front-end.sh: 9 * inspector/front-end/DOMAgent.js: 10 (WebInspector.DOMAgent.prototype.inspectElement): 11 (WebInspector.DOMDispatcher.prototype.inspectElementRequested): 12 * inspector/front-end/ElementsPanel.js: 13 (WebInspector.ElementsPanel.prototype._inspectElementRequested): 14 * inspector/front-end/ObjectPropertiesSection.js: 15 (WebInspector.ObjectPropertyTreeElement.prototype._contextMenuEventFired): 16 (WebInspector.ObjectPropertyTreeElement.prototype.startEditing): 17 * inspector/front-end/ResourcesPanel.js: 18 (WebInspector.ResourcesPanel.prototype._applyDiffMarkup): 19 * inspector/front-end/SourceFrame.js: 20 (WebInspector.SourceFrame.prototype._onShowPopover.showObjectPopover): 21 (WebInspector.SourceFrame.prototype._onShowPopover): 22 (WebInspector.SourceFrame.prototype._editBreakpointCondition): 23 (WebInspector.SourceFrame.prototype.startEditing): 24 (WebInspector.SourceFrame.prototype.commitEditing.didEditContent): 25 (WebInspector.SourceFrame.prototype.commitEditing): 26 (WebInspector.SourceFrameDelegate.prototype.requestContent): 27 (WebInspector.SourceFrameDelegate.prototype.debuggingSupported): 28 (WebInspector.SourceFrameDelegate.prototype.setBreakpoint): 29 (WebInspector.SourceFrameDelegate.prototype.removeBreakpoint): 30 (WebInspector.SourceFrameDelegate.prototype.updateBreakpoint): 31 (WebInspector.SourceFrameDelegate.prototype.findBreakpoint): 32 (WebInspector.SourceFrameDelegate.prototype.continueToLine): 33 (WebInspector.SourceFrameDelegate.prototype.canEditScriptSource): 34 (WebInspector.SourceFrameDelegate.prototype.setScriptSource): 35 (WebInspector.SourceFrameDelegate.prototype.setScriptSourceIsBeingEdited): 36 (WebInspector.SourceFrameDelegate.prototype.debuggerPaused): 37 (WebInspector.SourceFrameDelegate.prototype.evaluateInSelectedCallFrame): 38 (WebInspector.SourceFrameDelegate.prototype.releaseEvaluationResult): 39 (WebInspector.SourceFrameDelegate.prototype.suggestedFileName): 40 * inspector/front-end/externs.js: 41 (WebInspector.log): 42 * inspector/front-end/inspector.js: 43 (WebInspector.log.logMessage): 44 (WebInspector.log): 45 * inspector/front-end/utilities.js: 46 (): 47 1 48 2011-10-04 Mikhail Naganov <mnaganov@chromium.org> 2 49 -
trunk/Source/WebCore/inspector/compile-front-end.sh
r96597 r96604 94 94 --js Source/WebCore/inspector/front-end/UIUtils.js \ 95 95 --js Source/WebCore/inspector/front-end/View.js \ 96 --module jsmodule_inspector: 4:jsmodule_sdk,jsmodule_ui \96 --module jsmodule_inspector:7:jsmodule_sdk,jsmodule_ui \ 97 97 --js Source/WebCore/inspector/front-end/ConsoleMessage.js \ 98 98 --js Source/WebCore/inspector/front-end/ConsoleView.js \ 99 99 --js Source/WebCore/inspector/front-end/JavaScriptContextManager.js \ 100 --js Source/WebCore/inspector/front-end/ObjectPopoverHelper.js \ 101 --js Source/WebCore/inspector/front-end/ObjectPropertiesSection.js \ 102 --js Source/WebCore/inspector/front-end/SourceFrame.js \ 100 103 --js Source/WebCore/inspector/front-end/TimelineManager.js -
trunk/Source/WebCore/inspector/front-end/DOMAgent.js
r96499 r96604 618 618 }, 619 619 620 _inspectElementRequested: function(nodeId)620 inspectElement: function(nodeId) 621 621 { 622 622 var node = this._idToDOMNode[nodeId]; … … 705 705 }, 706 706 707 inspectElementRequested: function(nodeId)708 {709 this._domAgent._inspectElementRequested(nodeId);710 },711 712 707 searchResults: function(nodeIds) 713 708 { -
trunk/Source/WebCore/inspector/front-end/ElementsPanel.js
r96584 r96604 447 447 }, 448 448 449 _inspectElementRequested: function(node) 450 { 449 _inspectElementRequested: function(event) 450 { 451 var node = event.data; 451 452 WebInspector.updateFocusedNode(node.id); 452 453 }, -
trunk/Source/WebCore/inspector/front-end/ObjectPopoverHelper.js
r96599 r96604 29 29 */ 30 30 31 /** 32 * @constructor 33 * @extends {WebInspector.PopoverHelper} 34 */ 31 35 WebInspector.ObjectPopoverHelper = function(panelElement, getAnchor, queryObject, onHide, disableOnClick) 32 36 { -
trunk/Source/WebCore/inspector/front-end/ObjectPropertiesSection.js
r94754 r96604 25 25 */ 26 26 27 /** 28 * @constructor 29 * @extends {WebInspector.PropertiesSection} 30 * @param {string=} title 31 * @param {string=} subtitle 32 * @param {string=} emptyPlaceholder 33 * @param {string=} ignoreHasOwnProperty 34 * @param {Array.<WebInspector.RemoteObjectProperty>=} extraProperties 35 * @param {function()=} treeElementConstructor 36 */ 27 37 WebInspector.ObjectPropertiesSection = function(object, title, subtitle, emptyPlaceholder, ignoreHasOwnProperty, extraProperties, treeElementConstructor) 28 38 { … … 136 146 } 137 147 148 /** 149 * @constructor 150 * @extends {TreeElement} 151 */ 138 152 WebInspector.ObjectPropertyTreeElement = function(property) 139 153 { … … 221 235 }, 222 236 223 _contextMenuEventFired: function( )237 _contextMenuEventFired: function(event) 224 238 { 225 239 function selectNode(nodeId) 226 240 { 227 if (nodeId) { 228 WebInspector.panels.elements.switchToAndFocus(WebInspector.domAgent.nodeForId(nodeId)); 229 } 241 if (nodeId) 242 WebInspector.domAgent.inspectElement(nodeId); 230 243 } 231 244 … … 264 277 this.valueElement.textContent = this.valueElement._originalTextContent; 265 278 266 WebInspector.startEditing(this.valueElement, {267 context: context,268 commitHandler: this.editingCommitted.bind(this),269 cancelHandler: this.editingCancelled.bind(this)270 });279 var config = new WebInspector.EditingConfig(); 280 config.setContext(context); 281 config.setCommitHandler(this.editingCommitted.bind(this)); 282 config.setCancelHandler(this.editingCancelled.bind(this)); 283 WebInspector.startEditing(this.valueElement, config); 271 284 }, 272 285 -
trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js
r96577 r96604 408 408 }, 409 409 410 _applyDiffMarkup: function(view, baseContent, newContent) { 411 var oldLines = baseContent.split(/\r?\n/); 412 var newLines = newContent.split(/\r?\n/); 413 414 var diff = Array.diff(oldLines, newLines); 415 416 var diffData = {}; 417 diffData.added = []; 418 diffData.removed = []; 419 diffData.changed = []; 420 421 var offset = 0; 422 var right = diff.right; 423 for (var i = 0; i < right.length; ++i) { 424 if (typeof right[i] === "string") { 425 if (right.length > i + 1 && right[i + 1].row === i + 1 - offset) 426 diffData.changed.push(i); 427 else { 428 diffData.added.push(i); 429 offset++; 430 } 431 } else 432 offset = i - right[i].row; 433 } 410 _applyDiffMarkup: function(view, baseContent, newContent) 411 { 412 var diffData = TextDiff.compute(baseContent, newContent); 434 413 view.markDiff(diffData); 435 414 }, -
trunk/Source/WebCore/inspector/front-end/SourceFrame.js
r96599 r96604 29 29 */ 30 30 31 /** 32 * @extends {WebInspector.View} 33 * @constructor 34 */ 31 35 WebInspector.SourceFrame = function(delegate, url) 32 36 { … … 128 132 }, 129 133 134 /** 135 * @param {TextDiff} diffData 136 */ 130 137 markDiff: function(diffData) 131 138 { … … 442 449 }, 443 450 451 /** 452 * @param {boolean=} skipRevealLine 453 */ 444 454 setExecutionLine: function(lineNumber, skipRevealLine) 445 455 { … … 761 771 } 762 772 763 WebInspector.startEditing(this._conditionEditorElement, { 764 context: null, 765 commitHandler: finishEditing.bind(this, true), 766 cancelHandler: finishEditing.bind(this, false) 767 }); 773 var config = new WebInspector.EditingConfig(); 774 config.setCommitHandler(finishEditing.bind(this, true)); 775 config.setCancelHandler(finishEditing.bind(this, false)); 776 WebInspector.startEditing(this._conditionEditorElement, config); 768 777 this._conditionEditorElement.value = condition; 769 778 this._conditionEditorElement.select(); … … 813 822 }, 814 823 815 startEditing: function( lineNumber)824 startEditing: function() 816 825 { 817 826 if (!this.canEditSource()) … … 839 848 840 849 if (error) { 841 if (error.message) { 842 WebInspector.log(error.message, WebInspector.ConsoleMessage.MessageLevel.Error); 843 WebInspector.showConsole(); 844 } 850 if (error.message) 851 WebInspector.log(error.message, WebInspector.ConsoleMessage.MessageLevel.Error, true); 845 852 return; 846 853 } … … 896 903 897 904 905 /** 906 * @implements {WebInspector.TextViewerDelegate} 907 * @constructor 908 */ 898 909 WebInspector.TextViewerDelegateForSourceFrame = function(sourceFrame) 899 910 { … … 941 952 return this._sourceFrame.suggestedFileName(); 942 953 } 943 } ;954 } 944 955 945 956 WebInspector.TextViewerDelegateForSourceFrame.prototype.__proto__ = WebInspector.TextViewerDelegate.prototype; 946 957 947 958 959 /** 960 * @interface 961 */ 948 962 WebInspector.SourceFrameDelegate = function() 949 963 { … … 951 965 952 966 WebInspector.SourceFrameDelegate.prototype = { 953 requestContent: function(callback) 954 { 955 // Should be implemented by subclasses. 956 }, 957 958 debuggingSupported: function() 959 { 960 return false; 961 }, 962 963 setBreakpoint: function(lineNumber, condition, enabled) 964 { 965 // Should be implemented by subclasses. 966 }, 967 968 removeBreakpoint: function(lineNumber) 969 { 970 // Should be implemented by subclasses. 971 }, 972 973 updateBreakpoint: function(lineNumber, condition, enabled) 974 { 975 // Should be implemented by subclasses. 976 }, 977 978 findBreakpoint: function(lineNumber) 979 { 980 // Should be implemented by subclasses. 981 }, 982 983 continueToLine: function(lineNumber) 984 { 985 // Should be implemented by subclasses. 986 }, 987 988 canEditScriptSource: function() 989 { 990 return false; 991 }, 992 993 setScriptSource: function(text, callback) 994 { 995 // Should be implemented by subclasses. 996 }, 997 998 setScriptSourceIsBeingEdited: function(inEditMode) 999 { 1000 // Should be implemented by subclasses. 1001 }, 1002 1003 debuggerPaused: function() 1004 { 1005 // Should be implemented by subclasses. 1006 }, 1007 1008 evaluateInSelectedCallFrame: function(string) 1009 { 1010 // Should be implemented by subclasses. 1011 }, 1012 1013 releaseEvaluationResult: function() 1014 { 1015 // Should be implemented by subclasses. 1016 }, 1017 1018 suggestedFileName: function() 1019 { 1020 // Should be implemented by subclasses. 1021 } 967 requestContent: function(callback) { }, 968 969 debuggingSupported: function() { return false; }, 970 971 setBreakpoint: function(lineNumber, condition, enabled) { }, 972 973 removeBreakpoint: function(lineNumber) { }, 974 975 updateBreakpoint: function(lineNumber, condition, enabled) { }, 976 977 findBreakpoint: function(lineNumber) { }, 978 979 continueToLine: function(lineNumber) { }, 980 981 canEditScriptSource: function() { return false; }, 982 983 setScriptSource: function(text, callback) { }, 984 985 setScriptSourceIsBeingEdited: function(inEditMode) { }, 986 987 debuggerPaused: function() { }, 988 989 evaluateInSelectedCallFrame: function(string) { }, 990 991 releaseEvaluationResult: function() { }, 992 993 suggestedFileName: function() { } 1022 994 } -
trunk/Source/WebCore/inspector/front-end/externs.js
r96597 r96604 106 106 /** 107 107 * @constructor 108 */109 WebInspector.ObjectPropertiesSection = function(obj, title)110 {111 this.element = null;112 }113 114 /**115 * @constructor116 108 * @extends {TreeOutline} 117 109 */ … … 201 193 */ 202 194 Event.prototype.initWebKitWheelEvent = function(vararg) {} 195 196 /** 197 * @param {string=} messageLevel 198 * @param {boolean=} showConsole 199 */ 200 WebInspector.log = function(message, messageLevel, showConsole) {} -
trunk/Source/WebCore/inspector/front-end/inspector.js
r96591 r96604 958 958 } 959 959 960 WebInspector.log = function(message, messageLevel) 960 /** 961 * @param {string=} messageLevel 962 * @param {boolean=} showConsole 963 */ 964 WebInspector.log = function(message, messageLevel, showConsole) 961 965 { 962 966 // remember 'this' for setInterval() callback … … 1021 1025 1022 1026 self.console.addMessage(msg); 1027 if (showConsole) 1028 WebInspector.showConsole(); 1023 1029 } 1024 1030 -
trunk/Source/WebCore/inspector/front-end/utilities.js
r96597 r96604 970 970 } 971 971 972 /** 973 * @param {string=} extraFlags 974 */ 972 975 function createSearchRegex(query, extraFlags) 973 976 { … … 996 999 return result; 997 1000 } 1001 1002 /** 1003 * @constructor 1004 */ 1005 function TextDiff() 1006 { 1007 this.added = []; 1008 this.removed = []; 1009 this.changed = []; 1010 } 1011 1012 /** 1013 * @param {string} baseContent 1014 * @param {string} newContent 1015 * @return {TextDiff} 1016 */ 1017 TextDiff.compute = function(baseContent, newContent) 1018 { 1019 var oldLines = baseContent.split(/\r?\n/); 1020 var newLines = newContent.split(/\r?\n/); 1021 1022 var diff = Array.diff(oldLines, newLines); 1023 1024 var diffData = new TextDiff(); 1025 1026 var offset = 0; 1027 var right = diff.right; 1028 for (var i = 0; i < right.length; ++i) { 1029 if (typeof right[i] === "string") { 1030 if (right.length > i + 1 && right[i + 1].row === i + 1 - offset) 1031 diffData.changed.push(i); 1032 else { 1033 diffData.added.push(i); 1034 offset++; 1035 } 1036 } else 1037 offset = i - right[i].row; 1038 } 1039 return diffData; 1040 }
Note: See TracChangeset
for help on using the changeset viewer.