Changeset 269337 in webkit
- Timestamp:
- Nov 3, 2020 3:33:31 PM (21 months ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
Localizations/en.lproj/localizedStrings.js (modified) (1 diff)
-
UserInterface/Base/Main.js (modified) (1 diff)
-
UserInterface/Views/BreakpointPopover.js (modified) (1 diff)
-
UserInterface/Views/ContextMenuUtilities.js (modified) (1 diff)
-
UserInterface/Views/DOMTreeElement.js (modified) (2 diffs)
-
UserInterface/Views/DOMTreeOutline.js (modified) (1 diff)
-
UserInterface/Views/EventListenerSectionGroup.js (modified) (1 diff)
-
UserInterface/Views/SourceCodeTextEditor.js (modified) (1 diff)
-
UserInterface/Views/SourcesTabContentView.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r269201 r269337 1 2020-11-03 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Elements: should have the option to Edit Breakpoint... or at least Reveal Breakpoint in Sources Tab 4 https://bugs.webkit.org/show_bug.cgi?id=218366 5 6 Reviewed by Brian Burg. 7 8 * UserInterface/Views/BreakpointPopover.js: 9 (WI.BreakpointPopover.appendContextMenuItems): 10 * UserInterface/Views/DOMTreeElement.js: 11 (WI.DOMTreeElement.prototype.get statusImageElement): Added. 12 (WI.DOMTreeElement.prototype._statusImageContextmenu): 13 * UserInterface/Views/DOMTreeOutline.js: 14 (WI.DOMTreeOutline.prototype.populateContextMenu): 15 * UserInterface/Views/ContextMenuUtilities.js: 16 (WI.appendContextMenuItemsForDOMNodeBreakpoints): 17 Show an "Edit Breakpoint..." action (via `WI.BreakpointPopover.appendContextMenuItems`) when 18 there is only one `WI.DOMBreakpoint` (if there are multiple then it would be confusing), 19 otherwise using "Breakpoints" (plural) for the other actions. 20 21 * UserInterface/Base/Main.js: 22 (WI.showSourcesTab): 23 * UserInterface/Views/EventListenerSectionGroup.js: 24 (WI.EventListenerSectionGroup): 25 * UserInterface/Views/SourceCodeTextEditor.js: 26 (WI.SourceCodeTextEditor.prototype.textEditorGutterContextMenu): 27 * UserInterface/Views/SourcesTabContentView.js: 28 (WI.SourcesTabContentView.prototype.revealAndSelectRepresentedObject): Added. 29 (WI.SourcesTabContentView.prototype.revealAndSelectBreakpoint): Deleted. 30 Rename `breakpointToSelect` to `representedObjectToSelect` for more flexibility in the case 31 that there are multiple `WI.DOMBreakpoint` for the given `WI.DOMNode`, in which case we want 32 to select the `WI.DOMNode` instead. 33 34 * Localizations/en.lproj/localizedStrings.js: 35 1 36 2020-10-30 Nikita Vasilyev <nvasilyev@apple.com> 2 37 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r268716 r269337 1091 1091 localizedStrings["Reveal"] = "Reveal"; 1092 1092 localizedStrings["Reveal Blackbox Pattern"] = "Reveal Blackbox Pattern"; 1093 localizedStrings["Reveal Breakpoint in Sources Tab"] = "Reveal Breakpoint in Sources Tab"; 1094 localizedStrings["Reveal Breakpoints in Sources Tab"] = "Reveal Breakpoints in Sources Tab"; 1093 1095 localizedStrings["Reveal Descendant Breakpoints"] = "Reveal Descendant Breakpoints"; 1094 1096 localizedStrings["Reveal Local Override"] = "Reveal Local Override"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r269075 r269337 1201 1201 tabContentView = new WI.SourcesTabContentView; 1202 1202 1203 if (options. breakpointToSelect instanceof WI.Breakpoint)1204 tabContentView.revealAndSelect Breakpoint(options.breakpointToSelect);1203 if (options.representedObjectToSelect) 1204 tabContentView.revealAndSelectRepresentedObject(options.representedObjectToSelect); 1205 1205 1206 1206 if (options.showScopeChainSidebar) -
trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointPopover.js
r269023 r269337 53 53 static appendContextMenuItems(contextMenu, breakpoint, targetElement) 54 54 { 55 if (breakpoint.editable ) {55 if (breakpoint.editable && targetElement) { 56 56 contextMenu.appendItem(WI.UIString("Edit Breakpoint\u2026"), () => { 57 57 const delegate = null; -
trunk/Source/WebInspectorUI/UserInterface/Views/ContextMenuUtilities.js
r267723 r269337 406 406 } 407 407 408 contextMenu.appendSeparator(); 409 410 if (breakpoints.length) { 408 if (breakpoints.length && !WI.isShowingSourcesTab()) { 409 contextMenu.appendItem(breakpoints.length === 1 ? WI.UIString("Reveal Breakpoint in Sources Tab") : WI.UIString("Reveal Breakpoints in Sources Tab"), () => { 410 WI.showSourcesTab({ 411 representedObjectToSelect: breakpoints.length === 1 ? breakpoints[0] : domNode, 412 }); 413 }); 414 } 415 416 contextMenu.appendSeparator(); 417 418 if (breakpoints.length === 1) 419 WI.BreakpointPopover.appendContextMenuItems(contextMenu, breakpoints[0], options.popoverTargetElement); 420 else if (breakpoints.length) { 411 421 let shouldEnable = breakpoints.some((breakpoint) => breakpoint.disabled); 412 contextMenu.appendItem(shouldEnable ? WI.UIString("Enable Breakpoint ") : WI.UIString("Disable Breakpoint"), () => {422 contextMenu.appendItem(shouldEnable ? WI.UIString("Enable Breakpoints") : WI.UIString("Disable Breakpoints"), () => { 413 423 for (let breakpoint of breakpoints) 414 424 breakpoint.disabled = !shouldEnable; 415 425 }); 416 426 417 contextMenu.appendItem(WI.UIString("Delete Breakpoint "), () => {427 contextMenu.appendItem(WI.UIString("Delete Breakpoints"), () => { 418 428 for (let breakpoint of breakpoints) 419 429 WI.domDebuggerManager.removeDOMBreakpoint(breakpoint); -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
r262302 r269337 75 75 // Public 76 76 77 get statusImageElement() { return this._statusImageElement; } 78 77 79 get hasBreakpoint() 78 80 { … … 1973 1975 1974 1976 WI.appendContextMenuItemsForDOMNodeBreakpoints(contextMenu, this.representedObject, { 1977 popoverTargetElement: event.target, 1975 1978 revealDescendantBreakpointsMenuItemHandler: this.bindRevealDescendantBreakpointsMenuItemHandler(), 1976 1979 }); -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js
r257380 r269337 299 299 excludeRevealElement: this._excludeRevealElementContextMenu, 300 300 copySubMenu: subMenus.copy, 301 popoverTargetElement: treeElement.statusImageElement, 301 302 }; 302 303 -
trunk/Source/WebInspectorUI/UserInterface/Views/EventListenerSectionGroup.js
r266074 r269337 88 88 revealBreakpointGoToArrow.addEventListener("click", (event) => { 89 89 console.assert(this.hasEventListenerBreakpoint); 90 91 let breakpointToSelect = WI.domManager.breakpointForEventListenerId(this._eventListener.eventListenerId); 92 console.assert(breakpointToSelect); 93 94 WI.showSourcesTab({breakpointToSelect}); 90 WI.showSourcesTab({ 91 representedObjectToSelect: WI.domManager.breakpointForEventListenerId(this._eventListener.eventListenerId), 92 }); 95 93 }); 96 94 } -
trunk/Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js
r266480 r269337 1278 1278 contextMenu.appendItem(WI.UIString("Reveal in Sources Tab"), () => { 1279 1279 WI.showSourcesTab({ 1280 breakpointToSelect: breakpoints[0],1280 representedObjectToSelect: breakpoints[0], 1281 1281 initiatorHint: WI.TabBrowser.TabNavigationInitiator.ContextMenu, 1282 1282 }); -
trunk/Source/WebInspectorUI/UserInterface/Views/SourcesTabContentView.js
r268427 r269337 100 100 } 101 101 102 revealAndSelect Breakpoint(breakpoint)102 revealAndSelectRepresentedObject(representedObject) 103 103 { 104 console.assert(breakpoint instanceof WI.Breakpoint); 105 106 let treeElement = this.navigationSidebarPanel.treeElementForRepresentedObject(breakpoint); 107 if (treeElement) 108 treeElement.revealAndSelect(); 104 let treeElement = this.navigationSidebarPanel.treeElementForRepresentedObject(representedObject); 105 if (treeElement) { 106 const omitFocus = false; 107 const selectedByUser = true; 108 treeElement.revealAndSelect(omitFocus, selectedByUser); 109 } 109 110 } 110 111
Note: See TracChangeset
for help on using the changeset viewer.