Changeset 65939 in webkit
- Timestamp:
- Aug 24, 2010 3:16:55 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65937 r65939 1 2010-08-24 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: show DOM breakpoints in sidebar pane 6 https://bugs.webkit.org/show_bug.cgi?id=44424 7 8 * inspector/dom-breakpoints.html: 9 1 10 2010-08-24 Dumitru Daniliuc <dumi@chromium.org> 2 11 -
trunk/LayoutTests/inspector/dom-breakpoints.html
r65799 r65939 25 25 { 26 26 InspectorTest.addResult("Found div element."); 27 InspectorBackend.setDOMBreakpoint(node.id, WebInspector.ElementsTreeElement.DOMBreakpointTypeSubtreeModified);27 WebInspector.domBreakpointManager.setBreakpoint(node, WebInspector.DOMBreakpoint.Types.SubtreeModified); 28 28 InspectorTest.addResult("Set DOM breakpoint."); 29 29 InspectorTest.evaluateInConsole("appendElement()"); -
trunk/WebCore/ChangeLog
r65938 r65939 1 2010-08-24 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: show DOM breakpoints in sidebar pane 6 https://bugs.webkit.org/show_bug.cgi?id=44424 7 8 * inspector/front-end/BreakpointManager.js: 9 (WebInspector.BreakpointManager.prototype._setBreakpoint): 10 (WebInspector.BreakpointManager.prototype._breakpointRemoved): 11 (WebInspector.BreakpointManager.prototype._setBreakpointOnBackend): 12 (WebInspector.Breakpoint.prototype.set enabled): 13 (WebInspector.Breakpoint.prototype.set condition): 14 (WebInspector.Breakpoint.prototype.remove): 15 * inspector/front-end/BreakpointsSidebarPane.js: 16 (WebInspector.BreakpointsSidebarPane): 17 (WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint): 18 (WebInspector.BreakpointsSidebarPane.prototype._breakpointRemoved): 19 (WebInspector.BreakpointsSidebarPane.prototype._contextMenuEventFired): 20 (WebInspector.BreakpointItem): 21 (WebInspector.BreakpointItem.prototype.element): 22 (WebInspector.BreakpointItem.prototype.remove): 23 (WebInspector.BreakpointItem.prototype._checkboxClicked): 24 (WebInspector.BreakpointItem.prototype._enableChanged): 25 (WebInspector.BreakpointItem.prototype._removed): 26 (WebInspector.JSBreakpointItem): 27 (WebInspector.JSBreakpointItem.prototype._textChanged): 28 (WebInspector.DOMBreakpointItem): 29 (WebInspector.DOMBreakpointItem.prototype.compareTo): 30 * inspector/front-end/DOMAgent.js: 31 (WebInspector.DOMBreakpointManager): 32 (WebInspector.DOMBreakpointManager.prototype.setBreakpoint): 33 (WebInspector.DOMBreakpointManager.prototype.removeBreakpointsForNode): 34 (WebInspector.DOMBreakpointManager.prototype._breakpointRemoved): 35 (WebInspector.DOMBreakpoint): 36 (WebInspector.DOMBreakpoint.prototype.get enabled): 37 (WebInspector.DOMBreakpoint.prototype.set enabled): 38 (WebInspector.DOMBreakpoint.prototype.remove): 39 * inspector/front-end/ElementsPanel.js: 40 (WebInspector.ElementsPanel): 41 (WebInspector.ElementsPanel.prototype.reset): 42 * inspector/front-end/ElementsTreeOutline.js: 43 (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu): 44 * inspector/front-end/ScriptView.js: 45 (WebInspector.ScriptView): 46 * inspector/front-end/ScriptsPanel.js: 47 (WebInspector.ScriptsPanel): 48 (WebInspector.ScriptsPanel.prototype._breakpointAdded): 49 (WebInspector.ScriptsPanel.prototype.reset): 50 * inspector/front-end/SourceFrame.js: 51 (WebInspector.SourceFrame): 52 (WebInspector.SourceFrame.prototype.set visible): 53 (WebInspector.SourceFrame.prototype.addBreakpoint): 54 (WebInspector.SourceFrame.prototype._breakpointRemoved): 55 (WebInspector.SourceFrame.prototype._addBreakpointToSource): 56 (WebInspector.SourceFrame.prototype._removeBreakpointFromSource): 57 (WebInspector.SourceFrame.prototype._contextMenu.addConditionalBreakpoint): 58 (WebInspector.SourceFrame.prototype._contextMenu): 59 (WebInspector.SourceFrame.prototype._mouseDown): 60 * inspector/front-end/SourceView.js: 61 (WebInspector.SourceView): 62 (WebInspector.SourceView.prototype.updateLocalContent): 63 * inspector/front-end/inspector.js: 64 (WebInspector.createJSBreakpointsSidebarPane.breakpointAdded): 65 (WebInspector.createJSBreakpointsSidebarPane): 66 (WebInspector.createDOMBreakpointsSidebarPane.breakpointAdded): 67 (WebInspector.createDOMBreakpointsSidebarPane): 68 (WebInspector.doLoadedDone): 69 1 70 2010-08-24 Stephen White <senorblanco@chromium.org> 2 71 -
trunk/WebCore/inspector/front-end/BreakpointManager.js
r65810 r65939 63 63 }, 64 64 65 removeBreakpoint: function(breakpoint)66 {67 if (this._removeBreakpoint(breakpoint))68 InspectorBackend.removeBreakpoint(breakpoint.sourceID, breakpoint.line);69 },70 71 65 breakpointsForSourceID: function(sourceID) 72 66 { … … 103 97 delete this._oneTimeBreakpoint; 104 98 this._breakpoints[breakpoint.id] = breakpoint; 99 breakpoint.addEventListener("removed", this._breakpointRemoved, this); 105 100 this.dispatchEventToListeners("breakpoint-added", breakpoint); 106 101 return breakpoint; 107 102 }, 108 103 109 _removeBreakpoint: function(breakpoint) 110 { 111 if (!(breakpoint.id in this._breakpoints)) 112 return false; 113 breakpoint.dispatchEventToListeners("removed"); 114 breakpoint.removeAllListeners(); 115 delete breakpoint._breakpointManager; 116 delete this._breakpoints[breakpoint.id]; 117 return true; 104 _breakpointRemoved: function(event) 105 { 106 delete this._breakpoints[event.target.id]; 118 107 }, 119 108 … … 130 119 delete this._oneTimeBreakpoint; 131 120 } else { 132 this._removeBreakpoint(breakpoint);121 breakpoint.remove(); 133 122 if (success) 134 123 this._setBreakpoint(breakpoint.sourceID, breakpoint.url, line, breakpoint.enabled, breakpoint.condition); … … 166 155 this._enabled = x; 167 156 this._breakpointManager._setBreakpointOnBackend(this); 168 if (this._enabled) 169 this.dispatchEventToListeners("enabled"); 170 else 171 this.dispatchEventToListeners("disabled"); 157 this.dispatchEventToListeners("enable-changed"); 172 158 }, 173 159 … … 203 189 this._breakpointManager._setBreakpointOnBackend(this); 204 190 this.dispatchEventToListeners("condition-changed"); 191 }, 192 193 remove: function() 194 { 195 InspectorBackend.removeBreakpoint(this.sourceID, this.line); 196 this.dispatchEventToListeners("removed"); 197 this.removeAllListeners(); 198 delete this._breakpointManager; 205 199 } 206 200 } -
trunk/WebCore/inspector/front-end/BreakpointsSidebarPane.js
r65810 r65939 24 24 */ 25 25 26 WebInspector.BreakpointsSidebarPane = function( )27 { 28 WebInspector.SidebarPane.call(this, WebInspector.UIString("Breakpoints"));26 WebInspector.BreakpointsSidebarPane = function(title) 27 { 28 WebInspector.SidebarPane.call(this, title); 29 29 30 30 this.listElement = document.createElement("ol"); … … 48 48 }, 49 49 50 addBreakpoint: function(breakpoint )51 { 52 breakpoint .addEventListener("removed", this._breakpointRemoved, this);53 54 var breakpointElement = breakpoint.element();55 breakpointElement._breakpointObject = breakpoint;50 addBreakpoint: function(breakpointItem) 51 { 52 breakpointItem.addEventListener("removed", this._breakpointRemoved, this); 53 54 var element = breakpointItem.element(); 55 element._breakpointItem = breakpointItem; 56 56 57 57 var currentElement = this.listElement.firstChild; 58 58 while (currentElement) { 59 if (currentElement._breakpoint Object.compareTo(breakpointElement._breakpointObject) > 0) {60 this.listElement.insertBefore( breakpointElement, currentElement);59 if (currentElement._breakpointItem.compareTo(element._breakpointItem) > 0) { 60 this.listElement.insertBefore(element, currentElement); 61 61 break; 62 62 } … … 64 64 } 65 65 if (!currentElement) 66 this.listElement.appendChild(breakpointElement); 66 this.listElement.appendChild(element); 67 68 element.addEventListener("contextmenu", this._contextMenuEventFired.bind(this, breakpointItem), true); 67 69 68 70 if (this.emptyElement.parentElement) { … … 79 81 this.bodyElement.appendChild(this.emptyElement); 80 82 } 83 }, 84 85 _contextMenuEventFired: function(breakpointItem, event) 86 { 87 var contextMenu = new WebInspector.ContextMenu(); 88 contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), breakpointItem.remove.bind(breakpointItem)); 89 contextMenu.show(event); 81 90 } 82 91 } … … 84 93 WebInspector.BreakpointsSidebarPane.prototype.__proto__ = WebInspector.SidebarPane.prototype; 85 94 86 WebInspector. JSBreakpointItem = function(breakpoint)95 WebInspector.BreakpointItem = function(breakpoint) 87 96 { 88 97 this._breakpoint = breakpoint; 89 98 90 99 this._element = document.createElement("li"); 91 this._element.addEventListener("click", this._breakpointClicked.bind(this), false);92 100 93 101 var checkboxElement = document.createElement("input"); … … 98 106 this._element.appendChild(checkboxElement); 99 107 108 this._breakpoint.addEventListener("enable-changed", this._enableChanged, this); 109 this._breakpoint.addEventListener("removed", this._removed, this); 110 } 111 112 WebInspector.BreakpointItem.prototype = { 113 element: function() 114 { 115 return this._element; 116 }, 117 118 remove: function() 119 { 120 this._breakpoint.remove(); 121 }, 122 123 _checkboxClicked: function(event) 124 { 125 this._breakpoint.enabled = !this._breakpoint.enabled; 126 127 // without this, we'd switch to the source of the clicked breakpoint 128 event.stopPropagation(); 129 }, 130 131 _enableChanged: function() 132 { 133 var checkbox = this._element.firstChild; 134 checkbox.checked = this._breakpoint.enabled; 135 }, 136 137 _removed: function() 138 { 139 this.dispatchEventToListeners("removed"); 140 } 141 } 142 143 WebInspector.BreakpointItem.prototype.__proto__ = WebInspector.Object.prototype; 144 145 WebInspector.JSBreakpointItem = function(breakpoint) 146 { 147 WebInspector.BreakpointItem.call(this, breakpoint); 148 149 this._element.addEventListener("click", this._breakpointClicked.bind(this), false); 150 100 151 var displayName = this._breakpoint.url ? WebInspector.displayNameForURL(this._breakpoint.url) : WebInspector.UIString("(program)"); 101 152 var labelElement = document.createTextNode(displayName + ":" + this._breakpoint.line); … … 107 158 this._element.appendChild(sourceTextElement); 108 159 109 this._breakpoint.addEventListener("enabled", this._enableChanged, this);110 this._breakpoint.addEventListener("disabled", this._enableChanged, this);111 160 this._breakpoint.addEventListener("text-changed", this._textChanged, this); 112 this._breakpoint.addEventListener("removed", this._removed, this);113 161 } 114 162 … … 123 171 }, 124 172 125 element: function()126 {127 return this._element;128 },129 130 173 _breakpointClicked: function() 131 174 { 132 175 WebInspector.panels.scripts.showSourceLine(this._breakpoint.url, this._breakpoint.line); 133 },134 135 _checkboxClicked: function(event)136 {137 this._breakpoint.enabled = !this._breakpoint.enabled;138 139 // without this, we'd switch to the source of the clicked breakpoint140 event.stopPropagation();141 },142 143 _enableChanged: function()144 {145 var checkbox = this._element.firstChild;146 checkbox.checked = this._breakpoint.enabled;147 176 }, 148 177 … … 151 180 var sourceTextElement = this._element.firstChild.nextSibling.nextSibling; 152 181 sourceTextElement.textContent = this._breakpoint.sourceText; 153 }, 154 155 _removed: function() 156 { 157 this.dispatchEventToListeners("removed"); 158 } 159 } 160 161 WebInspector.JSBreakpointItem.prototype.__proto__ = WebInspector.Object.prototype; 182 } 183 } 184 185 WebInspector.JSBreakpointItem.prototype.__proto__ = WebInspector.BreakpointItem.prototype; 186 187 WebInspector.DOMBreakpointItem = function(breakpoint) 188 { 189 WebInspector.BreakpointItem.call(this, breakpoint); 190 191 var link = WebInspector.panels.elements.linkifyNodeReference(this._breakpoint.node); 192 this._element.appendChild(link); 193 194 var type = WebInspector.DOMBreakpoint.Labels[this._breakpoint.type]; 195 var typeElement = document.createTextNode(" - " + type); 196 this._element.appendChild(typeElement); 197 } 198 199 WebInspector.DOMBreakpointItem.prototype = { 200 compareTo: function(other) 201 { 202 if (this._breakpoint.type != other._breakpoint.type) 203 return this._breakpoint.type < other._breakpoint.type ? -1 : 1; 204 return 0; 205 } 206 } 207 208 WebInspector.DOMBreakpointItem.prototype.__proto__ = WebInspector.BreakpointItem.prototype; -
trunk/WebCore/inspector/front-end/DOMAgent.js
r65248 r65939 678 678 } 679 679 680 WebInspector.DOMBreakpointManager = function() 681 { 682 this._breakpoints = {}; 683 } 684 685 WebInspector.DOMBreakpointManager.prototype = { 686 setBreakpoint: function(node, type) 687 { 688 if (!(node.id in this._breakpoints)) 689 this._breakpoints[node.id] = {}; 690 else if (type in this._breakpoints[node.id]) 691 return; 692 693 var breakpoint = new WebInspector.DOMBreakpoint(node, type); 694 this._breakpoints[node.id][type] = breakpoint; 695 breakpoint.addEventListener("removed", this._breakpointRemoved, this); 696 697 this.dispatchEventToListeners("dom-breakpoint-added", breakpoint); 698 }, 699 700 removeBreakpointsForNode: function(node) 701 { 702 var nodeBreakpoints = this._breakpoints[node.id]; 703 for (var type in nodeBreakpoints) 704 nodeBreakpoints[type].remove(); 705 }, 706 707 _breakpointRemoved: function(event) 708 { 709 var breakpoint = event.target; 710 711 var nodeBreakpoints = this._breakpoints[breakpoint.node.id]; 712 delete nodeBreakpoints[breakpoint.type]; 713 for (var type in nodeBreakpoints) 714 return; 715 delete this._breakpoints[breakpoint.node.id]; 716 } 717 } 718 719 WebInspector.DOMBreakpointManager.prototype.__proto__ = WebInspector.Object.prototype; 720 721 WebInspector.DOMBreakpoint = function(node, type) 722 { 723 this.node = node; 724 this.type = type; 725 this._enabled = true; 726 727 InspectorBackend.setDOMBreakpoint(this.node.id, this.type); 728 } 729 730 WebInspector.DOMBreakpoint.Types = { 731 SubtreeModified: 0 732 }; 733 734 WebInspector.DOMBreakpoint.Labels = {}; 735 WebInspector.DOMBreakpoint.Labels[WebInspector.DOMBreakpoint.Types.SubtreeModified] = WebInspector.UIString("Subtree Modified"); 736 737 WebInspector.DOMBreakpoint.prototype = { 738 get enabled() 739 { 740 return this._enabled; 741 }, 742 743 set enabled(enabled) 744 { 745 if (this._enabled === enabled) 746 return; 747 748 this._enabled = enabled; 749 if (this._enabled) 750 InspectorBackend.setDOMBreakpoint(this.node.id, this.type); 751 else 752 InspectorBackend.removeDOMBreakpoint(this.node.id, this.type); 753 754 this.dispatchEventToListeners("enable-changed"); 755 }, 756 757 remove: function() 758 { 759 if (this._enabled) 760 InspectorBackend.removeDOMBreakpoint(this.node.id, this.type); 761 this.dispatchEventToListeners("removed"); 762 } 763 } 764 765 WebInspector.DOMBreakpoint.prototype.__proto__ = WebInspector.Object.prototype; 766 -
trunk/WebCore/inspector/front-end/ElementsPanel.js
r65248 r65939 75 75 this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane(); 76 76 this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane(); 77 if (Preferences.domBreakpointsEnabled) 78 this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane(); 77 79 this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPane(); 78 80 … … 91 93 this.sidebarElement.id = "elements-sidebar"; 92 94 93 this.sidebarElement.appendChild(this.sidebarPanes.computedStyle.element); 94 this.sidebarElement.appendChild(this.sidebarPanes.styles.element); 95 this.sidebarElement.appendChild(this.sidebarPanes.metrics.element); 96 this.sidebarElement.appendChild(this.sidebarPanes.properties.element); 97 this.sidebarElement.appendChild(this.sidebarPanes.eventListeners.element); 95 for (var pane in this.sidebarPanes) 96 this.sidebarElement.appendChild(this.sidebarPanes[pane].element); 98 97 99 98 this.sidebarResizeElement = document.createElement("div"); … … 180 179 181 180 delete this.currentQuery; 181 182 if (Preferences.domBreakpointsEnabled) 183 this.sidebarPanes.domBreakpoints.reset(); 182 184 }, 183 185 -
trunk/WebCore/inspector/front-end/ElementsTreeOutline.js
r65731 r65939 327 327 ].keySet(); 328 328 329 WebInspector.ElementsTreeElement.DOMBreakpointTypeSubtreeModified = 0;330 331 329 WebInspector.ElementsTreeElement.prototype = { 332 330 highlightSearchResults: function(searchQuery) … … 768 766 // Add debbuging-related actions 769 767 contextMenu.appendSeparator(); 768 770 769 contextMenu.appendItem(WebInspector.UIString("Stop on subtree modifications"), 771 InspectorBackend.setDOMBreakpoint.bind(InspectorBackend, this.representedObject.id, WebInspector.ElementsTreeElement.DOMBreakpointTypeSubtreeModified)); 770 WebInspector.domBreakpointManager.setBreakpoint.bind(WebInspector.domBreakpointManager, this.representedObject, WebInspector.DOMBreakpoint.Types.SubtreeModified)); 771 772 772 contextMenu.appendItem(WebInspector.UIString("Remove Breakpoints"), 773 InspectorBackend.removeDOMBreakpoint.bind(InspectorBackend, this.representedObject.id, WebInspector.ElementsTreeElement.DOMBreakpointTypeSubtreeModified));773 WebInspector.domBreakpointManager.removeBreakpointsForNode.bind(WebInspector.domBreakpointManager, this.representedObject)); 774 774 } 775 775 }, -
trunk/WebCore/inspector/front-end/ScriptView.js
r65052 r65939 35 35 this._sourceFrameSetup = false; 36 36 var canEditScripts = WebInspector.panels.scripts.canEditScripts(); 37 this.sourceFrame = new WebInspector.SourceFrame(this.element, this._addBreakpoint.bind(this), this._removeBreakpoint.bind(this),canEditScripts ? this._editLine.bind(this) : null, this._continueToLine.bind(this));37 this.sourceFrame = new WebInspector.SourceFrame(this.element, this._addBreakpoint.bind(this), canEditScripts ? this._editLine.bind(this) : null, this._continueToLine.bind(this)); 38 38 } 39 39 … … 130 130 showingLastSearchResult: WebInspector.SourceView.prototype.showingLastSearchResult, 131 131 _jumpToSearchResult: WebInspector.SourceView.prototype._jumpToSearchResult, 132 _removeBreakpoint: WebInspector.SourceView.prototype._removeBreakpoint,133 132 _editLine: WebInspector.SourceView.prototype._editLine, 134 133 resize: WebInspector.SourceView.prototype.resize -
trunk/WebCore/inspector/front-end/ScriptsPanel.js
r65810 r65939 133 133 this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane(); 134 134 this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane(); 135 this.sidebarPanes.breakpoints = new WebInspector.BreakpointsSidebarPane(); 135 this.sidebarPanes.jsBreakpoints = WebInspector.createJSBreakpointsSidebarPane(); 136 if (Preferences.domBreakpointsEnabled) 137 this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane(); 136 138 this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane(); 137 139 … … 143 145 144 146 this.sidebarPanes.scopechain.expanded = true; 145 this.sidebarPanes.breakpoints.expanded = true; 147 this.sidebarPanes.jsBreakpoints.expanded = true; 148 if (Preferences.domBreakpointsEnabled) 149 this.sidebarPanes.domBreakpoints.expanded = true; 146 150 147 151 var panelEnablerHeading = WebInspector.UIString("You need to enable debugging before you can use the Scripts panel."); … … 296 300 var breakpoint = event.data; 297 301 298 breakpoint.addEventListener("removed", this._breakpointRemoved, this);299 this.sidebarPanes.breakpoints.addBreakpoint(new WebInspector.JSBreakpointItem(event.data));300 301 302 var sourceFrame; 302 303 if (breakpoint.url) { … … 315 316 }, 316 317 317 _breakpointRemoved: function(event)318 {319 var breakpoint = event.target;320 321 var sourceFrame;322 if (breakpoint.url) {323 var resource = WebInspector.resourceURLMap[breakpoint.url];324 if (resource && resource.finished)325 sourceFrame = this._sourceFrameForScriptOrResource(resource);326 }327 328 if (breakpoint.sourceID && !sourceFrame) {329 var object = this._sourceIDMap[breakpoint.sourceID]330 sourceFrame = this._sourceFrameForScriptOrResource(object);331 }332 333 if (sourceFrame)334 sourceFrame.removeBreakpoint(breakpoint);335 },336 337 318 canEditScripts: function() 338 319 { … … 348 329 var breakpoints = WebInspector.breakpointManager.breakpointsForSourceID(sourceID); 349 330 for (var i = 0; i < breakpoints.length; ++i) 350 WebInspector.breakpointManager.removeBreakpoint(breakpoints[i]);331 breakpoints[i].remove(); 351 332 352 333 function mycallback(success, newBodyOrErrorMessage, callFrames) … … 497 478 this.sidebarPanes.watchExpressions.refreshExpressions(); 498 479 if (!preserveItems) { 499 this.sidebarPanes.breakpoints.reset(); 480 this.sidebarPanes.jsBreakpoints.reset(); 481 if (Preferences.domBreakpointsEnabled) 482 this.sidebarPanes.domBreakpoints.reset(); 500 483 this.sidebarPanes.workers.reset(); 501 484 } -
trunk/WebCore/inspector/front-end/SourceFrame.js
r65810 r65939 29 29 */ 30 30 31 WebInspector.SourceFrame = function(parentElement, addBreakpointDelegate, removeBreakpointDelegate,editDelegate, continueToHereDelegate)31 WebInspector.SourceFrame = function(parentElement, addBreakpointDelegate, editDelegate, continueToHereDelegate) 32 32 { 33 33 this._parentElement = parentElement; … … 45 45 this._continueToHereDelegate = continueToHereDelegate; 46 46 this._addBreakpointDelegate = addBreakpointDelegate; 47 this._removeBreakpointDelegate = removeBreakpointDelegate;48 47 this._editDelegate = editDelegate; 49 48 this._popoverObjectGroup = "popover"; … … 56 55 this._visible = visible; 57 56 this._createViewerIfNeeded(); 58 57 59 58 if (visible) { 60 59 if (this._textViewer && this._scrollTop) … … 100 99 { 101 100 this.breakpoints.push(breakpoint); 101 breakpoint.addEventListener("removed", this._breakpointRemoved, this); 102 102 if (this._textViewer) 103 103 this._addBreakpointToSource(breakpoint); 104 104 }, 105 105 106 removeBreakpoint: function(breakpoint) 107 { 106 _breakpointRemoved: function(event) 107 { 108 var breakpoint = event.target; 109 108 110 this.breakpoints.remove(breakpoint); 109 breakpoint.removeEventListener("enabled", null, this);110 breakpoint.removeEventListener("disabled", null, this);111 breakpoint.removeEventListener("condition-changed", null, this);112 111 if (this._textViewer) 113 112 this._removeBreakpointFromSource(breakpoint); … … 382 381 _addBreakpointToSource: function(breakpoint) 383 382 { 384 breakpoint.addEventListener("enabled", this._breakpointChanged, this); 385 breakpoint.addEventListener("disabled", this._breakpointChanged, this); 383 breakpoint.addEventListener("enable-changed", this._breakpointChanged, this); 386 384 breakpoint.addEventListener("condition-changed", this._breakpointChanged, this); 387 385 … … 404 402 _removeBreakpointFromSource: function(breakpoint) 405 403 { 404 breakpoint.removeEventListener("enable-changed", null, this); 405 breakpoint.removeEventListener("condition-changed", null, this); 406 406 407 var lineNumber = breakpoint.line - 1; 407 408 this._textViewer.beginUpdates(); … … 433 434 contextMenu.appendItem(WebInspector.UIString("Add Breakpoint"), this._addBreakpointDelegate.bind(this, lineNumber + 1)); 434 435 435 function addConditionalBreakpoint() 436 function addConditionalBreakpoint() 436 437 { 437 438 this._addBreakpointDelegate(lineNumber + 1); … … 444 445 } else { 445 446 // This row has a breakpoint, we want to show edit and remove breakpoint, and either disable or enable. 446 contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), this._removeBreakpointDelegate.bind(this,breakpoint));447 contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), breakpoint.remove.bind(breakpoint)); 447 448 contextMenu.appendItem(WebInspector.UIString("Edit Breakpoint…"), this._editBreakpointCondition.bind(this, breakpoint)); 448 449 if (breakpoint.enabled) … … 477 478 breakpoint.enabled = !breakpoint.enabled; 478 479 else 479 this._removeBreakpointDelegate(breakpoint);480 breakpoint.remove(); 480 481 } else 481 482 this._addBreakpointDelegate(lineNumber + 1); -
trunk/WebCore/inspector/front-end/SourceView.js
r64133 r65939 34 34 35 35 var canEditScripts = WebInspector.panels.scripts && WebInspector.panels.scripts.canEditScripts() && resource.type === WebInspector.Resource.Type.Script; 36 this.sourceFrame = new WebInspector.SourceFrame(this.contentElement, this._addBreakpoint.bind(this), this._removeBreakpoint.bind(this),canEditScripts ? this._editLine.bind(this) : null, this._continueToLine.bind(this));36 this.sourceFrame = new WebInspector.SourceFrame(this.contentElement, this._addBreakpoint.bind(this), canEditScripts ? this._editLine.bind(this) : null, this._continueToLine.bind(this)); 37 37 resource.addEventListener("finished", this._resourceLoadingFinished, this); 38 38 this._frameNeedsSetup = true; … … 131 131 if (!WebInspector.panels.scripts.breakpointsActivated) 132 132 WebInspector.panels.scripts.toggleBreakpointsClicked(); 133 },134 135 _removeBreakpoint: function(breakpoint)136 {137 WebInspector.breakpointManager.removeBreakpoint(breakpoint);138 133 }, 139 134 … … 214 209 this.localContentElement.className = "resource-view-content"; 215 210 this.tabbedPane.appendTab("local", WebInspector.UIString("Local"), this.localContentElement, this.selectLocalContentTab.bind(this)); 216 this.localSourceFrame = new WebInspector.SourceFrame(this.localContentElement, this._addBreakpoint.bind(this), this._removeBreakpoint.bind(this),null, this._continueToLine.bind(this));211 this.localSourceFrame = new WebInspector.SourceFrame(this.localContentElement, this._addBreakpoint.bind(this), null, this._continueToLine.bind(this)); 217 212 } 218 213 this.localSourceFrame.setContent(mimeType, content, ""); -
trunk/WebCore/inspector/front-end/inspector.js
r65905 r65939 198 198 }, 199 199 200 createJSBreakpointsSidebarPane: function() 201 { 202 var pane = new WebInspector.BreakpointsSidebarPane(WebInspector.UIString("Breakpoints")); 203 function breakpointAdded(event) 204 { 205 pane.addBreakpoint(new WebInspector.JSBreakpointItem(event.data)); 206 } 207 WebInspector.breakpointManager.addEventListener("breakpoint-added", breakpointAdded); 208 return pane; 209 }, 210 211 createDOMBreakpointsSidebarPane: function() 212 { 213 var pane = new WebInspector.BreakpointsSidebarPane(WebInspector.UIString("DOM Breakpoints")); 214 function breakpointAdded(event) 215 { 216 pane.addBreakpoint(new WebInspector.DOMBreakpointItem(event.data)); 217 } 218 WebInspector.domBreakpointManager.addEventListener("dom-breakpoint-added", breakpointAdded); 219 return pane; 220 }, 221 200 222 _createPanels: function() 201 223 { … … 497 519 498 520 this.breakpointManager = new WebInspector.BreakpointManager(); 521 this.domBreakpointManager = new WebInspector.DOMBreakpointManager(); 499 522 this.cssModel = new WebInspector.CSSStyleModel(); 500 523
Note: See TracChangeset
for help on using the changeset viewer.