Changeset 246026 in webkit
- Timestamp:
- Jun 2, 2019 5:05:10 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r246025 r246026 1 2019-06-02 Matt Baker <mattbaker@apple.com> 2 3 Web Inspector: Debugger: sidebar should always reveal active call frame when hitting a breakpoint 4 https://bugs.webkit.org/show_bug.cgi?id=198228 5 <rdar://problem/46719447> 6 7 Reviewed by Devin Rousso. 8 9 Reveal the active call frame TreeElement when call frames change. Refreshing 10 the current target's ThreadTreeElement children is insufficient, since 11 the sidebar panel content may have been scrolled. 12 13 This patch also introduces a workaround to prevent the DetailsSection header 14 element, which has sticky positioning, from covering a revealed TreeElement. 15 This can be the case when the TreeElement being revealed is at the topmost edge 16 of the scrolled content element. 17 18 * UserInterface/Base/Utilities.js: 19 20 * UserInterface/Views/DebuggerSidebarPanel.js: 21 (WI.DebuggerSidebarPanel.prototype.createContentTreeOutline): 22 (WI.DebuggerSidebarPanel.prototype._debuggerCallFramesDidChange): 23 24 * UserInterface/Views/DetailsSection.js: 25 (WI.DetailsSection.prototype.get element): 26 (WI.DetailsSection.prototype.get headerElement): 27 (WI.DetailsSection.prototype.get identifier): 28 29 * UserInterface/Views/SourcesNavigationSidebarPanel.js: 30 (WI.SourcesNavigationSidebarPanel.prototype.createContentTreeOutline): 31 (WI.SourcesNavigationSidebarPanel.prototype._handleDebuggerCallFramesDidChange): 32 33 * UserInterface/Views/TreeElement.js: 34 (WI.TreeElement.prototype.reveal): 35 * UserInterface/Views/TreeOutline.js: 36 1 37 2019-06-02 Devin Rousso <drousso@apple.com> 2 38 -
trunk/Source/WebInspectorUI/UserInterface/Base/Utilities.js
r245991 r246026 389 389 }); 390 390 391 Object.defineProperty(Element.prototype, "totalOffsetBottom", 392 { 393 get() 394 { 395 return this.getBoundingClientRect().bottom; 396 } 397 }); 398 391 399 Object.defineProperty(Element.prototype, "removeChildren", 392 400 { -
trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js
r245827 r246026 162 162 163 163 let breakpointsGroup = new WI.DetailsSectionGroup([breakpointsRow]); 164 letbreakpointsSection = new WI.DetailsSection("breakpoints", WI.UIString("Breakpoints"), [breakpointsGroup], breakpointNavigationBarWrapper);165 this.contentView.element.appendChild( breakpointsSection.element);164 this._breakpointsSection = new WI.DetailsSection("breakpoints", WI.UIString("Breakpoints"), [breakpointsGroup], breakpointNavigationBarWrapper); 165 this.contentView.element.appendChild(this._breakpointsSection.element); 166 166 167 167 this._breakpointsContentTreeOutline.addEventListener(WI.TreeOutline.Event.ElementAdded, this._handleBreakpointElementAddedOrRemoved, this); … … 328 328 329 329 return this._addScript(representedObject); 330 } 331 332 createContentTreeOutline(options = {}) 333 { 334 let treeOutline = super.createContentTreeOutline(options) 335 336 treeOutline.addEventListener(WI.TreeOutline.Event.ElementRevealed, (event) => { 337 let treeElement = event.data.element; 338 let detailsSections = [this._pauseReasonSection, this._callStackSection, this._breakpointsSection, this._scriptsSection]; 339 let detailsSection = detailsSections.find((detailsSection) => detailsSection.element.contains(treeElement.listItemElement)); 340 if (!detailsSection) 341 return; 342 343 // Revealing a TreeElement at the scroll container's topmost edge with 344 // scrollIntoViewIfNeeded may result in the element being covered by the 345 // DetailsSection header, which uses sticky positioning. Detect this case, 346 // and adjust the sidebar content's scroll position to compensate. 347 let offset = detailsSection.headerElement.totalOffsetBottom - treeElement.listItemElement.totalOffsetTop; 348 if (offset > 0) 349 this.scrollElement.scrollBy(0, -offset); 350 }); 351 352 return treeOutline; 330 353 } 331 354 … … 863 886 let treeElement = this._findThreadTreeElementForTarget(target); 864 887 treeElement.refresh(); 888 889 let activeCallFrameTreeElement = this._callStackTreeOutline.findTreeElement(WI.debuggerManager.activeCallFrame); 890 if (activeCallFrameTreeElement) 891 activeCallFrameTreeElement.reveal(); 865 892 } 866 893 -
trunk/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js
r228216 r246026 66 66 // Public 67 67 68 get element() 69 { 70 return this._element; 71 } 72 73 get identifier() 74 { 75 return this._identifier; 76 } 68 get element() { return this._element; } 69 get headerElement() { return this._headerElement; } 70 get identifier() { return this._identifier; } 77 71 78 72 get title() -
trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js
r245827 r246026 475 475 // Protected 476 476 477 createContentTreeOutline(options = {}) 478 { 479 let treeOutline = super.createContentTreeOutline(options) 480 481 treeOutline.addEventListener(WI.TreeOutline.Event.ElementRevealed, (event) => { 482 let treeElement = event.data.element; 483 let detailsSections = [this._pauseReasonSection, this._callStackSection, this._breakpointsSection]; 484 let detailsSection = detailsSections.find((detailsSection) => detailsSection.element.contains(treeElement.listItemElement)); 485 if (!detailsSection) 486 return; 487 488 // Revealing a TreeElement at the scroll container's topmost edge with 489 // scrollIntoViewIfNeeded may result in the element being covered by the 490 // DetailsSection header, which uses sticky positioning. Detect this case, 491 // and adjust the sidebar content's scroll position to compensate. 492 let offset = detailsSection.headerElement.totalOffsetBottom - treeElement.listItemElement.totalOffsetTop; 493 if (offset > 0) 494 this.scrollElement.scrollBy(0, -offset); 495 }); 496 497 return treeOutline; 498 } 499 477 500 resetFilter() 478 501 { … … 1729 1752 if (treeElement) 1730 1753 treeElement.refresh(); 1754 1755 let activeCallFrameTreeElement = this._callStackTreeOutline.findTreeElement(WI.debuggerManager.activeCallFrame); 1756 if (activeCallFrameTreeElement) 1757 activeCallFrameTreeElement.reveal(); 1731 1758 } 1732 1759 -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeElement.js
r245166 r246026 489 489 if (this.onreveal) 490 490 this.onreveal(this); 491 492 if (this.treeOutline) 493 this.treeOutline.dispatchEventToListeners(WI.TreeOutline.Event.ElementRevealed, {element: this}); 491 494 } 492 495 -
trunk/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js
r244435 r246026 1160 1160 ElementDidChange: Symbol("element-did-change"), 1161 1161 ElementRemoved: Symbol("element-removed"), 1162 ElementRevealed: Symbol("element-revealed"), 1162 1163 ElementClicked: Symbol("element-clicked"), 1163 1164 ElementDisclosureDidChanged: Symbol("element-disclosure-did-change"),
Note: See TracChangeset
for help on using the changeset viewer.