Changeset 248873 in webkit
- Timestamp:
- Aug 19, 2019 3:21:21 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r248860 r248873 1 2019-08-19 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: REGRESSION: Debugger: pressing delete when the all/uncaught exceptions breakpoint is selected should select the next tree element 4 https://bugs.webkit.org/show_bug.cgi?id=200876 5 6 Reviewed by Joseph Pecoraro. 7 8 Removing the `return true;` from the various `WI.TreeElement` breakpoint classes allows the 9 owner `WI.TreeOutline` to also handle the delete event. In the Debugger/Sources navigation 10 sidebar, the owner `WI.TreeOutline` checks to see if the currently selected `WI.TreeElement` 11 is one of the "top" items ("All Exceptions", "Uncaught Exceptions", "Assertion Failures") 12 and if so, select the next tree element (if able) instead of the previous one. 13 14 This is a preferred experience because the "top" items can only be disabled, not deleted, so 15 trying to delete them wouldn't actually change the selection. They should only ever be 16 selected if there's nothing else that can be selected. 17 18 * UserInterface/Views/DebuggerSidebarPanel.js: 19 (WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement): 20 (WI.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement.checkIfSelectionAdjustmentNeeded): Added. 21 * UserInterface/Views/SourcesNavigationSidebarPanel.js: 22 (WI.SourcesNavigationSidebarPanel): 23 (WI.SourcesNavigationSidebarPanel.checkIfSelectionAdjustmentNeeded): Added. 24 25 * UserInterface/Views/BreakpointTreeElement.js: 26 (WI.BreakpointTreeElement.prototype.ondelete): 27 * UserInterface/Views/DOMBreakpointTreeElement.js: 28 (WI.DOMBreakpointTreeElement.prototype.ondelete): 29 * UserInterface/Views/DOMNodeTreeElement.js: 30 (WI.DOMNodeTreeElement.prototype.ondelete): 31 * UserInterface/Views/EventBreakpointTreeElement.js: 32 (WI.EventBreakpointTreeElement.prototype.ondelete): 33 * UserInterface/Views/URLBreakpointTreeElement.js: 34 (WI.URLBreakpointTreeElement.prototype.ondelete): 35 1 36 2019-08-19 Devin Rousso <drousso@apple.com> 2 37 -
trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js
r244274 r248873 83 83 else 84 84 this._breakpoint.disabled = true; 85 return true;85 return; 86 86 } 87 87 … … 92 92 93 93 WI.debuggerManager.removeBreakpoint(this._breakpoint); 94 return true;95 94 } 96 95 -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js
r247252 r248873 107 107 108 108 WI.domDebuggerManager.removeDOMBreakpoint(this.representedObject); 109 return true;110 109 } 111 110 -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMNodeTreeElement.js
r247053 r248873 48 48 WI.domDebuggerManager.removeDOMBreakpointsForNode(this.representedObject); 49 49 WI.domManager.removeEventListenerBreakpointsForNode(this.representedObject); 50 51 return true;52 50 } 53 51 -
trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
r248537 r248873 979 979 } 980 980 981 _breakpointTreeOutlineDeleteTreeElement(treeElement) 982 { 983 console.assert(treeElement.selected); 984 985 if (treeElement.representedObject === DebuggerSidebarPanel.__windowEventTargetRepresentedObject) { 981 _breakpointTreeOutlineDeleteTreeElement(selectedTreeElement) 982 { 983 console.assert(selectedTreeElement.selected); 984 985 let treeElementToSelect = null; 986 function checkIfSelectionAdjustmentNeeded(treeElement) { 987 if (!treeElement) 988 return; 989 990 let representedObjects = [ 991 WI.debuggerManager.allExceptionsBreakpoint, 992 WI.debuggerManager.uncaughtExceptionsBreakpoint, 993 WI.debuggerManager.assertionFailuresBreakpoint, 994 ]; 995 if (representedObjects.includes(treeElement.representedObject)) 996 treeElementToSelect = selectedTreeElement.nextSibling; 997 } 998 checkIfSelectionAdjustmentNeeded(selectedTreeElement); 999 1000 if (selectedTreeElement instanceof WI.ResourceTreeElement || selectedTreeElement instanceof WI.ScriptTreeElement) { 1001 checkIfSelectionAdjustmentNeeded(selectedTreeElement.previousSibling); 1002 1003 let breakpoints = this._breakpointsBeneathTreeElement(selectedTreeElement); 1004 this._removeAllBreakpoints(breakpoints); 1005 } else if (selectedTreeElement.representedObject === DebuggerSidebarPanel.__windowEventTargetRepresentedObject) { 1006 checkIfSelectionAdjustmentNeeded(selectedTreeElement.previousSibling); 1007 986 1008 let eventBreakpointsOnWindow = WI.domManager.eventListenerBreakpoints.filter((eventBreakpoint) => eventBreakpoint.eventListener.onWindow); 987 1009 for (let eventBreakpoint of eventBreakpointsOnWindow) 988 1010 WI.domManager.removeBreakpointForEventListener(eventBreakpoint.eventListener); 989 return true; 990 } 991 992 console.assert(treeElement instanceof WI.ResourceTreeElement || treeElement instanceof WI.ScriptTreeElement); 993 if (!(treeElement instanceof WI.ResourceTreeElement) && !(treeElement instanceof WI.ScriptTreeElement)) 994 return false; 995 996 var wasTopResourceTreeElement = treeElement.previousSibling === this._assertionsBreakpointTreeElement || treeElement.previousSibling === this._allUncaughtExceptionsBreakpointTreeElement; 997 var nextSibling = treeElement.nextSibling; 998 999 var breakpoints = this._breakpointsBeneathTreeElement(treeElement); 1000 this._removeAllBreakpoints(breakpoints); 1001 1002 if (wasTopResourceTreeElement && nextSibling) 1003 nextSibling.select(true, true); 1011 } 1012 1013 if (treeElementToSelect) { 1014 const omitFocus = true; 1015 const selectedByUser = true; 1016 treeElementToSelect.select(omitFocus, selectedByUser); 1017 } 1004 1018 1005 1019 return true; -
trunk/Source/WebInspectorUI/UserInterface/Views/EventBreakpointTreeElement.js
r247053 r248873 93 93 else 94 94 WI.domDebuggerManager.removeEventBreakpoint(this.representedObject); 95 return true;96 95 } 97 96 -
trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js
r248753 r248873 139 139 this._breakpointsTreeOutline.addEventListener(WI.TreeOutline.Event.ElementRemoved, this._handleBreakpointElementAddedOrRemoved, this); 140 140 this._breakpointsTreeOutline.addEventListener(WI.TreeOutline.Event.SelectionDidChange, this._handleTreeSelectionDidChange, this); 141 this._breakpointsTreeOutline.ondelete = (treeElement) => { 142 console.assert(treeElement.selected); 143 144 if (treeElement.representedObject === SourcesNavigationSidebarPanel.__windowEventTargetRepresentedObject) { 141 this._breakpointsTreeOutline.ondelete = (selectedTreeElement) => { 142 console.assert(selectedTreeElement.selected); 143 144 let treeElementToSelect = null; 145 function checkIfSelectionAdjustmentNeeded(treeElement) { 146 if (!treeElement) 147 return; 148 149 let representedObjects = [ 150 WI.debuggerManager.allExceptionsBreakpoint, 151 WI.debuggerManager.uncaughtExceptionsBreakpoint, 152 WI.debuggerManager.assertionFailuresBreakpoint, 153 ]; 154 if (representedObjects.includes(treeElement.representedObject)) 155 treeElementToSelect = selectedTreeElement.nextSibling; 156 } 157 checkIfSelectionAdjustmentNeeded(selectedTreeElement); 158 159 if (selectedTreeElement instanceof WI.ResourceTreeElement || selectedTreeElement instanceof WI.ScriptTreeElement) { 160 checkIfSelectionAdjustmentNeeded(selectedTreeElement.previousSibling); 161 162 let breakpoints = this._breakpointsBeneathTreeElement(selectedTreeElement); 163 this._removeAllBreakpoints(breakpoints); 164 } else if (selectedTreeElement.representedObject === SourcesNavigationSidebarPanel.__windowEventTargetRepresentedObject) { 165 checkIfSelectionAdjustmentNeeded(selectedTreeElement.previousSibling); 166 145 167 let eventBreakpointsOnWindow = WI.domManager.eventListenerBreakpoints.filter((eventBreakpoint) => eventBreakpoint.eventListener.onWindow); 146 168 for (let eventBreakpoint of eventBreakpointsOnWindow) 147 169 WI.domManager.removeBreakpointForEventListener(eventBreakpoint.eventListener); 148 return true; 149 } 150 151 console.assert(treeElement instanceof WI.ResourceTreeElement || treeElement instanceof WI.ScriptTreeElement); 152 if (!(treeElement instanceof WI.ResourceTreeElement) && !(treeElement instanceof WI.ScriptTreeElement)) 153 return false; 154 155 let wasTopResourceTreeElement = treeElement.previousSibling === this._assertionsBreakpointTreeElement || treeElement.previousSibling === this._allUncaughtExceptionsBreakpointTreeElement; 156 let nextSibling = treeElement.nextSibling; 157 158 let breakpoints = this._breakpointsBeneathTreeElement(treeElement); 159 this._removeAllBreakpoints(breakpoints); 160 161 if (wasTopResourceTreeElement && nextSibling) { 170 } 171 172 if (treeElementToSelect) { 162 173 const omitFocus = true; 163 174 const selectedByUser = true; 164 nextSibling.select(omitFocus, selectedByUser);175 treeElementToSelect.select(omitFocus, selectedByUser); 165 176 } 166 177 -
trunk/Source/WebInspectorUI/UserInterface/Views/URLBreakpointTreeElement.js
r247237 r248873 95 95 96 96 WI.domDebuggerManager.removeURLBreakpoint(this.representedObject); 97 return true;98 97 } 99 98
Note: See TracChangeset
for help on using the changeset viewer.