Changeset 83864 in webkit
- Timestamp:
- Apr 14, 2011 9:18:48 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r83862 r83864 1 2011-04-14 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: re-implement dom breakpoints. 6 https://bugs.webkit.org/show_bug.cgi?id=57038 7 8 * inspector/debugger/dom-breakpoints.html: 9 1 10 2011-04-14 Satish Sampath <satish@chromium.org> 2 11 -
trunk/LayoutTests/inspector/debugger/dom-breakpoints.html
r80422 r83864 27 27 function test() 28 28 { 29 var pane = WebInspector.domBreakpointsSidebarPane; 29 30 var rootElement; 30 31 InspectorTest.runDebuggerTestSuite([ … … 37 38 { 38 39 rootElement = node; 39 WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified);40 pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true); 40 41 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement."); 41 42 InspectorTest.evaluateInPageWithTimeout("appendElement('rootElement', 'childElement')"); … … 62 63 function step2() 63 64 { 64 rootElement.breakpoints[WebInspector.DOMBreakpointTypes.SubtreeModified].remove();65 pane._removeBreakpoint(rootElement, pane._breakpointTypes.SubtreeModified); 65 66 next(); 66 67 } … … 70 71 { 71 72 InspectorTest.addResult("Test that 'Attribute Modified' breakpoint is hit when modifying attribute."); 72 WebInspector.breakpointManager.createDOMBreakpoint(rootElement.id, WebInspector.DOMBreakpointTypes.AttributeModified);73 pane._setBreakpoint(rootElement, pane._breakpointTypes.AttributeModified, true); 73 74 InspectorTest.addResult("Set 'Attribute Modified' DOM breakpoint on rootElement."); 74 75 InspectorTest.evaluateInPageWithTimeout("modifyAttribute('rootElement', 'className', 'foo')"); … … 78 79 function step2(callFrames) 79 80 { 80 rootElement.breakpoints[WebInspector.DOMBreakpointTypes.AttributeModified].remove();81 pane._removeBreakpoint(rootElement, pane._breakpointTypes.AttributeModified); 81 82 next(); 82 83 } … … 90 91 function step2(node) 91 92 { 92 WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.NodeRemoved);93 pane._setBreakpoint(node, pane._breakpointTypes.NodeRemoved, true); 93 94 InspectorTest.addResult("Set 'Node Removed' DOM breakpoint on elementToRemove."); 94 95 InspectorTest.evaluateInPageWithTimeout("removeElement('elementToRemove')"); … … 105 106 function step2(node) 106 107 { 107 WebInspector.breakpointManager.createDOMBreakpoint(node.id, WebInspector.DOMBreakpointTypes.SubtreeModified); 108 pane._setBreakpoint(node, pane._breakpointTypes.SubtreeModified, true); 109 pane._saveBreakpoints(); 108 110 InspectorTest.addResult("Set 'Subtree Modified' DOM breakpoint on rootElement."); 109 111 InspectorTest.reloadPage(step3); … … 122 124 { 123 125 InspectorTest.waitUntilPaused(paused); 124 InspectorTest.addSniffer(WebInspector.DOMBreakpointView.prototype, "_format", format); 125 126 InspectorTest.addSniffer(WebInspector.CallStackSidebarPane.prototype, "setStatus", setStatus); 126 127 127 128 var caption; 128 129 var callFrames; 129 130 130 function format(element)131 function setStatus(status) 131 132 { 132 caption = element.textContent; 133 if (typeof status === "string") 134 caption = status; 135 else 136 caption = status.textContent; 133 137 if (callFrames) 134 138 step1(); -
trunk/Source/WebCore/ChangeLog
r83862 r83864 1 2011-04-14 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: re-implement dom breakpoints. 6 https://bugs.webkit.org/show_bug.cgi?id=57038 7 8 * WebCore.gypi: 9 * WebCore.vcproj/WebCore.vcproj: 10 * inspector/front-end/BreakpointManager.js: Removed. 11 * inspector/front-end/BreakpointsSidebarPane.js: 12 (WebInspector.NativeBreakpointsSidebarPane): 13 (WebInspector.NativeBreakpointsSidebarPane.prototype._reset): 14 (WebInspector.XHRBreakpointsSidebarPane.prototype._restoreBreakpoints): 15 * inspector/front-end/CallStackSidebarPane.js: 16 (WebInspector.CallStackSidebarPane.prototype.update): 17 (WebInspector.CallStackSidebarPane.prototype.setStatus): 18 * inspector/front-end/DOMAgent.js: 19 (WebInspector.DOMNode): 20 (WebInspector.DOMAgent.prototype._childNodeRemoved): 21 * inspector/front-end/DOMBreakpointsSidebarPane.js: Added. 22 (WebInspector.DOMBreakpointsSidebarPane): 23 (WebInspector.DOMBreakpointsSidebarPane.prototype.setInspectedURL): 24 (WebInspector.DOMBreakpointsSidebarPane.prototype.populateNodeContextMenu.toggleBreakpoint): 25 (WebInspector.DOMBreakpointsSidebarPane.prototype.populateNodeContextMenu): 26 (WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage.didPushNodeToFrontend): 27 (WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage): 28 (WebInspector.DOMBreakpointsSidebarPane.prototype._doCreateBreakpointHitStatusMessage.formatters.s): 29 (WebInspector.DOMBreakpointsSidebarPane.prototype._doCreateBreakpointHitStatusMessage.append): 30 (WebInspector.DOMBreakpointsSidebarPane.prototype._doCreateBreakpointHitStatusMessage): 31 (WebInspector.DOMBreakpointsSidebarPane.prototype.nodeRemoved): 32 (WebInspector.DOMBreakpointsSidebarPane.prototype._removeBreakpointsForNode): 33 (WebInspector.DOMBreakpointsSidebarPane.prototype._setBreakpoint): 34 (WebInspector.DOMBreakpointsSidebarPane.prototype._removeBreakpoint): 35 (WebInspector.DOMBreakpointsSidebarPane.prototype._contextMenu.removeBreakpoint): 36 (WebInspector.DOMBreakpointsSidebarPane.prototype._contextMenu): 37 (WebInspector.DOMBreakpointsSidebarPane.prototype._checkboxClicked): 38 (WebInspector.DOMBreakpointsSidebarPane.prototype.highlightBreakpoint): 39 (WebInspector.DOMBreakpointsSidebarPane.prototype.clearBreakpointHighlight): 40 (WebInspector.DOMBreakpointsSidebarPane.prototype._createBreakpointId): 41 (WebInspector.DOMBreakpointsSidebarPane.prototype._saveBreakpoints): 42 (WebInspector.DOMBreakpointsSidebarPane.prototype.restoreBreakpoints): 43 * inspector/front-end/ElementsPanel.js: 44 (WebInspector.ElementsPanel): 45 (WebInspector.ElementsPanel.prototype.show): 46 (WebInspector.ElementsPanel.prototype.updateModifiedNodes): 47 (WebInspector.ElementsPanel.prototype.updateBreadcrumbSizes.coalesceCollapsedCrumbs): 48 * inspector/front-end/ElementsTreeOutline.js: 49 (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu): 50 * inspector/front-end/ScriptsPanel.js: 51 (WebInspector.ScriptsPanel): 52 (WebInspector.ScriptsPanel.prototype.show): 53 (WebInspector.ScriptsPanel.prototype._debuggerPaused.didCreateBreakpointHitStatusMessage): 54 (WebInspector.ScriptsPanel.prototype._debuggerPaused.else.didGetSourceLocation): 55 (WebInspector.ScriptsPanel.prototype._debuggerPaused): 56 (WebInspector.ScriptsPanel.prototype._clearInterface): 57 * inspector/front-end/Settings.js: 58 (WebInspector.Settings): 59 (WebInspector.Settings.prototype._set): 60 * inspector/front-end/WebKit.qrc: 61 * inspector/front-end/inspector.html: 62 * inspector/front-end/inspector.js: 63 (WebInspector.inspectedURLChanged): 64 * inspector/front-end/utilities.js: 65 (): 66 1 67 2011-04-14 Satish Sampath <satish@chromium.org> 2 68 -
trunk/Source/WebCore/WebCore.gypi
r83832 r83864 6153 6153 'inspector/front-end/AuditsPanel.js', 6154 6154 'inspector/front-end/BottomUpProfileDataGridTree.js', 6155 'inspector/front-end/BreakpointManager.js',6156 6155 'inspector/front-end/BreakpointsSidebarPane.js', 6157 6156 'inspector/front-end/CallStackSidebarPane.js', … … 6176 6175 'inspector/front-end/DetailedHeapshotView.js', 6177 6176 'inspector/front-end/DOMAgent.js', 6177 'inspector/front-end/DOMBreakpointsSidebarPane.js', 6178 6178 'inspector/front-end/DOMStorage.js', 6179 6179 'inspector/front-end/DOMStorageItemsView.js', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r83832 r83864 66946 66946 </File> 66947 66947 <File 66948 RelativePath="..\inspector\front-end\BreakpointManager.js"66949 >66950 </File>66951 <File66952 66948 RelativePath="..\inspector\front-end\BreakpointsSidebarPane.js" 66953 66949 > … … 67039 67035 <File 67040 67036 RelativePath="..\inspector\front-end\DOMAgent.js" 67037 > 67038 </File> 67039 <File 67040 RelativePath="..\inspector\front-end\DOMBreakpointsSidebarPane.js" 67041 67041 > 67042 67042 </File> -
trunk/Source/WebCore/inspector/front-end/BreakpointsSidebarPane.js
r82685 r83864 205 205 206 206 this.bodyElement.appendChild(this.emptyElement); 207 208 WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.ProjectChanged, this._projectChanged, this);209 207 } 210 208 211 209 WebInspector.NativeBreakpointsSidebarPane.prototype = { 212 addBreakpointItem: function(breakpointItem)213 {214 var element = breakpointItem.element;215 element._breakpointItem = breakpointItem;216 217 breakpointItem.addEventListener("breakpoint-hit", this.expand, this);218 breakpointItem.addEventListener("removed", this._removeListElement.bind(this, element), this);219 220 var currentElement = this.listElement.firstChild;221 while (currentElement) {222 if (currentElement._breakpointItem && currentElement._breakpointItem.compareTo(element._breakpointItem) > 0)223 break;224 currentElement = currentElement.nextSibling;225 }226 this._addListElement(element, currentElement);227 228 if (breakpointItem.click) {229 element.addStyleClass("cursor-pointer");230 element.addEventListener("click", breakpointItem.click.bind(breakpointItem), false);231 }232 element.addEventListener("contextmenu", this._contextMenuEventFired.bind(this, breakpointItem), true);233 },234 235 _contextMenuEventFired: function(breakpointItem, event)236 {237 var contextMenu = new WebInspector.ContextMenu();238 contextMenu.appendItem(WebInspector.UIString("Remove Breakpoint"), breakpointItem.remove.bind(breakpointItem));239 contextMenu.show(event);240 },241 242 210 _addListElement: function(element, beforeElement) 243 211 { … … 262 230 }, 263 231 264 _ projectChanged: function()232 _reset: function() 265 233 { 266 234 this.listElement.removeChildren(); … … 445 413 this._setBreakpoint(breakpoint.url, breakpoint.enabled); 446 414 } 447 },448 449 _projectChanged: function()450 {451 415 } 452 416 } 453 417 454 418 WebInspector.XHRBreakpointsSidebarPane.prototype.__proto__ = WebInspector.NativeBreakpointsSidebarPane.prototype; 455 456 WebInspector.BreakpointItem = function(breakpoint)457 {458 this._breakpoint = breakpoint;459 460 this._element = document.createElement("li");461 462 var checkboxElement = document.createElement("input");463 checkboxElement.className = "checkbox-elem";464 checkboxElement.type = "checkbox";465 checkboxElement.checked = this._breakpoint.enabled;466 checkboxElement.addEventListener("click", this._checkboxClicked.bind(this), false);467 this._element.appendChild(checkboxElement);468 469 this._createLabelElement();470 471 this._breakpoint.addEventListener("enable-changed", this._enableChanged, this);472 this._breakpoint.addEventListener("hit-state-changed", this._hitStateChanged, this);473 this._breakpoint.addEventListener("label-changed", this._labelChanged, this);474 this._breakpoint.addEventListener("removed", this.dispatchEventToListeners.bind(this, "removed"));475 if (breakpoint.click)476 this.click = breakpoint.click.bind(breakpoint);477 }478 479 WebInspector.BreakpointItem.prototype = {480 get element()481 {482 return this._element;483 },484 485 compareTo: function(other)486 {487 return this._breakpoint.compareTo(other._breakpoint);488 },489 490 populateEditElement: function(element)491 {492 this._breakpoint.populateEditElement(element);493 },494 495 remove: function()496 {497 this._breakpoint.remove();498 },499 500 _checkboxClicked: function(event)501 {502 this._breakpoint.enabled = !this._breakpoint.enabled;503 504 // Breakpoint element may have it's own click handler.505 event.stopPropagation();506 },507 508 _enableChanged: function(event)509 {510 var checkbox = this._element.firstChild;511 checkbox.checked = this._breakpoint.enabled;512 },513 514 _hitStateChanged: function(event)515 {516 if (event.target.hit) {517 this._element.addStyleClass("breakpoint-hit");518 this.dispatchEventToListeners("breakpoint-hit");519 } else520 this._element.removeStyleClass("breakpoint-hit");521 },522 523 _labelChanged: function(event)524 {525 this._element.removeChild(this._labelElement);526 this._createLabelElement();527 },528 529 _createLabelElement: function()530 {531 this._labelElement = document.createElement("span");532 this._breakpoint.populateLabelElement(this._labelElement);533 this._element.appendChild(this._labelElement);534 }535 }536 537 WebInspector.BreakpointItem.prototype.__proto__ = WebInspector.Object.prototype;538 419 539 420 WebInspector.EventListenerBreakpointsSidebarPane = function() -
trunk/Source/WebCore/inspector/front-end/CallStackSidebarPane.js
r83290 r83864 73 73 this.placards.push(placard); 74 74 this.bodyElement.appendChild(placard.element); 75 }76 77 if (details.eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint) {78 if (details.eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.DOM)79 this._domBreakpointHit(details.eventData);80 75 } 81 76 }, … … 177 172 var statusMessageElement = document.createElement("div"); 178 173 statusMessageElement.className = "info"; 179 statusMessageElement.textContent = status; 180 this.bodyElement.appendChild(statusMessageElement); 181 }, 182 183 _domBreakpointHit: function(eventData) 184 { 185 var breakpoint = WebInspector.breakpointManager.breakpointViewForEventData(eventData); 186 if (!breakpoint) 187 return; 188 189 var statusMessageElement = document.createElement("div"); 190 statusMessageElement.className = "info"; 191 breakpoint.populateStatusMessageElement(statusMessageElement, eventData); 174 if (typeof status === "string") 175 statusMessageElement.textContent = status; 176 else 177 statusMessageElement.appendChild(status); 192 178 this.bodyElement.appendChild(statusMessageElement); 193 179 } -
trunk/Source/WebCore/inspector/front-end/DOMAgent.js
r83707 r83864 60 60 this._matchedCSSRules = []; 61 61 62 this.breakpoints = {};63 64 62 if (this._nodeType === Node.ELEMENT_NODE) { 65 63 // HTML and BODY from internal iframes should not overwrite top-level ones. … … 505 503 this.dispatchEventToListeners(WebInspector.DOMAgent.Events.NodeRemoved, {node:node, parent:parent}); 506 504 delete this._idToDOMNode[nodeId]; 507 this._removeBreakpoints(node); 508 }, 509 510 _removeBreakpoints: function(node) 511 { 512 for (var type in node.breakpoints) 513 node.breakpoints[type].remove(); 514 if (!node.children) 515 return; 516 for (var i = 0; i < node.children.length; ++i) 517 this._removeBreakpoints(node.children[i]); 505 WebInspector.panels.elements.sidebarPanes.domBreakpoints.nodeRemoved(node); 518 506 }, 519 507 -
trunk/Source/WebCore/inspector/front-end/ElementsPanel.js
r83848 r83864 80 80 this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane(); 81 81 if (Preferences.nativeInstrumentationEnabled) 82 this.sidebarPanes.domBreakpoints = WebInspector. createDOMBreakpointsSidebarPane();82 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane; 83 83 this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPane(); 84 84 … … 154 154 this.updateModifiedNodes(); 155 155 156 if (Preferences.nativeInstrumentationEnabled) 157 this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.eventListeners.element); 158 156 159 if (!this.rootDOMNode) 157 160 WebInspector.domAgent.requestDocument(); … … 200 203 return; 201 204 202 WebInspector.breakpointManager.restoreDOMBreakpoints();203 205 if (Preferences.nativeInstrumentationEnabled) 206 this.sidebarPanes.domBreakpoints.restoreBreakpoints(); 204 207 205 208 this.rootDOMNode = inspectedRootDocument; … … 484 487 continue; 485 488 } 486 489 487 490 if (!parent) 488 491 continue; … … 769 772 var crumb = crumbs.firstChild; 770 773 while (crumb) { 771 // Find the selected crumb and index. 774 // Find the selected crumb and index. 772 775 if (!selectedCrumb && crumb.hasStyleClass("selected")) { 773 776 selectedCrumb = crumb; … … 775 778 } 776 779 777 // Find the focused crumb index. 780 // Find the focused crumb index. 778 781 if (crumb === focusedCrumb) 779 782 focusedIndex = i; … … 884 887 var hidden = crumb.hasStyleClass("hidden"); 885 888 if (!hidden) { 886 var collapsed = crumb.hasStyleClass("collapsed"); 889 var collapsed = crumb.hasStyleClass("collapsed"); 887 890 if (collapsedRun && collapsed) { 888 891 crumb.addStyleClass("hidden"); -
trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js
r81663 r83864 792 792 // Add debbuging-related actions 793 793 contextMenu.appendSeparator(); 794 795 function handlerFunction(nodeId, breakType) 796 { 797 WebInspector.breakpointManager.createDOMBreakpoint(nodeId, breakType); 798 WebInspector.panels.elements.sidebarPanes.domBreakpoints.expand(); 799 } 800 var node = this.representedObject; 801 for (var key in WebInspector.DOMBreakpointTypes) { 802 var type = WebInspector.DOMBreakpointTypes[key]; 803 var label = WebInspector.domBreakpointTypeContextMenuLabel(type); 804 var breakpoint = node.breakpoints[type]; 805 if (!breakpoint) 806 var handler = handlerFunction.bind(this, node.id, type); 807 else 808 var handler = breakpoint.remove.bind(breakpoint); 809 contextMenu.appendCheckboxItem(label, handler, !!breakpoint); 810 } 794 var pane = WebInspector.panels.elements.sidebarPanes.domBreakpoints; 795 pane.populateNodeContextMenu(this.representedObject, contextMenu); 811 796 } 812 797 }, -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r83713 r83864 136 136 this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSidebarPane(this._presentationModel, this._showSourceLine.bind(this)); 137 137 if (Preferences.nativeInstrumentationEnabled) { 138 this.sidebarPanes.domBreakpoints = WebInspector. createDOMBreakpointsSidebarPane();138 this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane; 139 139 this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPane(); 140 140 this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane(); … … 201 201 }; 202 202 203 WebInspector.ScriptsPanel.BrowserBreakpointTypes = { 204 DOM: "DOM", 205 EventListener: "EventListener", 206 XHR: "XHR" 207 } 208 203 209 WebInspector.ScriptsPanel.prototype = { 204 210 get toolbarItemLabel() … … 226 232 WebInspector.Panel.prototype.show.call(this); 227 233 this.sidebarResizeElement.style.right = (this.sidebarElement.offsetWidth - 3) + "px"; 234 if (Preferences.nativeInstrumentationEnabled) 235 this.sidebarElement.insertBefore(this.sidebarPanes.domBreakpoints.element, this.sidebarPanes.xhrBreakpoints.element); 228 236 229 237 if (this.visibleView) … … 367 375 this.sidebarPanes.callstack.selectedCallFrame = this._presentationModel.selectedCallFrame; 368 376 369 var status;370 377 if (details.eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint) { 371 if (details.eventData.breakpointType === WebInspector.BreakpointManager.BreakpointTypes.EventListener) { 378 if (details.eventData.breakpointType === WebInspector.ScriptsPanel.BrowserBreakpointTypes.DOM) { 379 this.sidebarPanes.domBreakpoints.highlightBreakpoint(details.eventData); 380 function didCreateBreakpointHitStatusMessage(element) 381 { 382 this.sidebarPanes.callstack.setStatus(element); 383 } 384 this.sidebarPanes.domBreakpoints.createBreakpointHitStatusMessage(details.eventData, didCreateBreakpointHitStatusMessage.bind(this)); 385 } else if (details.eventData.breakpointType === WebInspector.ScriptsPanel.BrowserBreakpointTypes.EventListener) { 372 386 var eventName = details.eventData.eventName; 373 387 this.sidebarPanes.eventListenerBreakpoints.highlightBreakpoint(details.eventData.eventName); 374 388 var eventNameForUI = WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName); 375 status = WebInspector.UIString("Paused on a \"%s\" Event Listener.", eventNameForUI);376 } else if (details.eventData.breakpointType === WebInspector. BreakpointManager.BreakpointTypes.XHR) {389 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a \"%s\" Event Listener.", eventNameForUI)); 390 } else if (details.eventData.breakpointType === WebInspector.ScriptsPanel.BrowserBreakpointTypes.XHR) { 377 391 this.sidebarPanes.xhrBreakpoints.highlightBreakpoint(details.eventData.breakpointURL); 378 status = WebInspector.UIString("Paused on a XMLHttpRequest.");392 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a XMLHttpRequest.")); 379 393 } 380 394 } else { … … 384 398 return; 385 399 this.sidebarPanes.jsBreakpoints.highlightBreakpoint(sourceFileId, lineNumber); 386 status = WebInspector.UIString("Paused on a JavaScript breakpoint.");400 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a JavaScript breakpoint.")); 387 401 } 388 402 callFrames[0].sourceLine(didGetSourceLocation.bind(this)); 389 403 } 390 if (status)391 this.sidebarPanes.callstack.setStatus(status);392 404 393 405 window.focus(); … … 743 755 this.sidebarPanes.jsBreakpoints.clearBreakpointHighlight(); 744 756 if (Preferences.nativeInstrumentationEnabled) { 757 this.sidebarPanes.domBreakpoints.clearBreakpointHighlight(); 745 758 this.sidebarPanes.eventListenerBreakpoints.clearBreakpointHighlight(); 746 759 this.sidebarPanes.xhrBreakpoints.clearBreakpointHighlight(); -
trunk/Source/WebCore/inspector/front-end/Settings.js
r82191 r83864 73 73 this.installApplicationSetting("breakpoints", []); 74 74 this.installApplicationSetting("eventListenerBreakpoints", []); 75 this.installApplicationSetting("domBreakpoints", []); 75 76 this.installApplicationSetting("xhrBreakpoints", []); 76 77 this.installProjectSetting("nativeBreakpoints", []);78 }79 80 WebInspector.Settings.Events = {81 ProjectChanged: "project-changed"82 77 } 83 78 … … 90 85 this.__defineGetter__(key, this._get.bind(this, key, defaultValue)); 91 86 this.__defineSetter__(key, this._set.bind(this, key)); 92 },93 94 installProjectSetting: function(key, defaultValue)95 {96 this.__defineGetter__(key, this._getProjectSetting.bind(this, key, defaultValue));97 this.__defineSetter__(key, this._setProjectSetting.bind(this, key));98 },99 100 inspectedURLChanged: function(url)101 {102 var fragmentIndex = url.indexOf("#");103 if (fragmentIndex !== -1)104 url = url.substring(0, fragmentIndex);105 this._projectId = url;106 this.dispatchEventToListeners(WebInspector.Settings.Events.ProjectChanged);107 },108 109 get projectId()110 {111 return this._projectId;112 },113 114 findSettingForAllProjects: function(key)115 {116 var result = {};117 if (window.localStorage == null)118 return result;119 120 var regexp = "^" + key + ":(.*)";121 for (var i = 0; i < window.localStorage.length; ++i) {122 var fullKey = window.localStorage.key(i);123 var match = fullKey.match(regexp);124 if (!match)125 continue;126 try {127 result[match[1]] = JSON.parse(window.localStorage[fullKey]);128 } catch(e) {129 window.localStorage.removeItem(fullKey);130 }131 }132 return result;133 87 }, 134 88 … … 149 103 if (window.localStorage != null) 150 104 window.localStorage[key] = JSON.stringify(value); 151 },152 153 _getProjectSetting: function(key, defaultValue)154 {155 return this._get(this._formatProjectKey(key), defaultValue);156 },157 158 _setProjectSetting: function(key, value)159 {160 return this._set(this._formatProjectKey(key), value);161 },162 163 _formatProjectKey: function(key)164 {165 return key + ":" + this._projectId;166 105 } 167 106 } -
trunk/Source/WebCore/inspector/front-end/WebKit.qrc
r83718 r83864 10 10 <file>AuditsPanel.js</file> 11 11 <file>BottomUpProfileDataGridTree.js</file> 12 <file>BreakpointManager.js</file>13 12 <file>BreakpointsSidebarPane.js</file> 14 13 <file>CallStackSidebarPane.js</file> … … 34 33 <file>SourceFile.js</file> 35 34 <file>DOMAgent.js</file> 35 <file>DOMBreakpointsSidebarPane.js</file> 36 36 <file>DOMStorage.js</file> 37 37 <file>DOMStorageItemsView.js</file> -
trunk/Source/WebCore/inspector/front-end/inspector.html
r83718 r83864 74 74 <script type="text/javascript" src="ApplicationCacheItemsView.js"></script> 75 75 <script type="text/javascript" src="Script.js"></script> 76 <script type="text/javascript" src="BreakpointManager.js"></script>77 76 <script type="text/javascript" src="SidebarPane.js"></script> 78 77 <script type="text/javascript" src="ElementsTreeOutline.js"></script> … … 83 82 <script type="text/javascript" src="ObjectPropertiesSection.js"></script> 84 83 <script type="text/javascript" src="BreakpointsSidebarPane.js"></script> 84 <script type="text/javascript" src="DOMBreakpointsSidebarPane.js"></script> 85 85 <script type="text/javascript" src="CallStackSidebarPane.js"></script> 86 86 <script type="text/javascript" src="ScopeChainSidebarPane.js"></script> -
trunk/Source/WebCore/inspector/front-end/inspector.js
r83861 r83864 172 172 }, 173 173 174 createDOMBreakpointsSidebarPane: function()175 {176 var pane = new WebInspector.NativeBreakpointsSidebarPane(WebInspector.UIString("DOM Breakpoints"));177 function breakpointAdded(event)178 {179 pane.addBreakpointItem(new WebInspector.BreakpointItem(event.data));180 }181 WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.DOMBreakpointAdded, breakpointAdded);182 return pane;183 },184 185 174 _createPanels: function() 186 175 { … … 461 450 this.debuggerModel = new WebInspector.DebuggerModel(); 462 451 463 this.breakpointManager = new WebInspector.BreakpointManager();464 452 this.searchController = new WebInspector.SearchController(); 453 this.domBreakpointsSidebarPane = new WebInspector.DOMBreakpointsSidebarPane(); 465 454 466 455 this.panels = {}; … … 1036 1025 { 1037 1026 InspectorFrontendHost.inspectedURLChanged(url); 1038 this. settings.inspectedURLChanged(url);1027 this.domBreakpointsSidebarPane.setInspectedURL(url); 1039 1028 this.extensionServer.notifyInspectedURLChanged(url); 1040 1029 } -
trunk/Source/WebCore/inspector/front-end/utilities.js
r82818 r83864 450 450 result = result.replace(new RegExp("^" + baseURLDomain.escapeForRegExp(), "i"), ""); 451 451 return result; 452 } 453 454 String.prototype.removeURLFragment = function() 455 { 456 var fragmentIndex = this.indexOf("#"); 457 if (fragmentIndex == -1) 458 fragmentIndex = this.length; 459 return this.substring(0, fragmentIndex); 452 460 } 453 461
Note: See TracChangeset
for help on using the changeset viewer.