WebKit Bugzilla
Attachment 370582 Details for
Bug 198228
: Web Inspector: Debugger: sidebar should always reveal active call frame when hitting a breakpoint
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198228-20190524131030.patch (text/plain), 7.71 KB, created by
Matt Baker
on 2019-05-24 13:10:30 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Matt Baker
Created:
2019-05-24 13:10:30 PDT
Size:
7.71 KB
patch
obsolete
>Subversion Revision: 245751 >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 788d30a070f3617f9e68040cc0c4c435e933c316..fbcea15585b48040be9a13e151cecb17f8a20d7a 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,35 @@ >+2019-05-24 Matt Baker <mattbaker@apple.com> >+ >+ Web Inspector: Debugger: sidebar should always reveal active call frame when hitting a breakpoint >+ https://bugs.webkit.org/show_bug.cgi?id=198228 >+ <rdar://problem/46719447> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Reveal the active call frame TreeElement when call frames change. Refreshing >+ the current target's ThreadTreeElement children is insufficient, since >+ the sidebar panel content may have scrolled. >+ >+ This patch also introduces a workaround to prevent the DetailsSection header >+ element, which has sticky positioning, from covering a revealed TreeElement. >+ This can be the case when the TreeElement being revealed is at the topmost edge >+ of the scrolled content element. >+ >+ * UserInterface/Views/DebuggerSidebarPanel.js: >+ (WI.DebuggerSidebarPanel.prototype._debuggerCallFramesDidChange): >+ >+ * UserInterface/Views/DetailsSection.js: >+ (WI.DetailsSection): >+ (WI.DetailsSection.prototype.get headerElement): >+ >+ * UserInterface/Views/NavigationSidebarPanel.js: >+ (WI.NavigationSidebarPanel.prototype.createContentTreeOutline): >+ (WI.NavigationSidebarPanel.prototype._treeElementRevealed): >+ >+ * UserInterface/Views/TreeElement.js: >+ (WI.TreeElement.prototype.reveal): >+ * UserInterface/Views/TreeOutline.js: >+ > 2019-05-24 Devin Rousso <drousso@apple.com> > > Web Inspector: Overlay: don't show setting for showing rulers/guides during element selection if it's not supported >diff --git a/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js b/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js >index bd56b03b8df27d8a64cd1cc57d95b934ef137e15..081358c6a90861c1adfd44aed82381198d028455 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js >+++ b/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js >@@ -862,6 +862,10 @@ WI.DebuggerSidebarPanel = class DebuggerSidebarPanel extends WI.NavigationSideba > let target = event.data.target; > let treeElement = this._findThreadTreeElementForTarget(target); > treeElement.refresh(); >+ >+ let activeCallFrameTreeElement = this._callStackTreeOutline.selectedTreeElement; >+ if (activeCallFrameTreeElement) >+ activeCallFrameTreeElement.reveal(); > } > > _debuggerActiveCallFrameDidChange() >diff --git a/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js b/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js >index aa3b18f78968bb9c4eb3ad5f800874600a4210c6..faf8b9983457c04087effd681841c1cea52985c8 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js >+++ b/Source/WebInspectorUI/UserInterface/Views/DetailsSection.js >@@ -33,6 +33,8 @@ WI.DetailsSection = class DetailsSection extends WI.Object > > this._element = document.createElement("div"); > this._element.classList.add(identifier, "details-section"); >+ // FIXME: Remove once <https://webkit.org/b/152269> is finished. >+ this._element.__detailsSection = this; > > this._headerElement = document.createElement("div"); > this._headerElement.addEventListener("click", this._headerElementClicked.bind(this)); >@@ -85,6 +87,11 @@ WI.DetailsSection = class DetailsSection extends WI.Object > this._titleElement.textContent = title; > } > >+ get headerElement() >+ { >+ return this._headerElement; >+ } >+ > get titleElement() > { > return this._titleElement; >diff --git a/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js b/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js >index edc33a8caa76fd250afe52a70505bec8877fc5ab..958c089168af616be9805b78a6c46384ef5892ba 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js >+++ b/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js >@@ -146,6 +146,8 @@ WI.NavigationSidebarPanel = class NavigationSidebarPanel extends WI.SidebarPanel > contentTreeOutline.addEventListener(WI.TreeOutline.Event.ElementDisclosureDidChanged, this._treeElementDisclosureDidChange, this); > } > >+ contentTreeOutline.addEventListener(WI.TreeOutline.Event.ElementRevealed, this._treeElementRevealed, this); >+ > contentTreeOutline[WI.NavigationSidebarPanel.IgnoreCookieRestoration] = ignoreCookieRestoration; > contentTreeOutline[WI.NavigationSidebarPanel.SuppressFilteringSymbol] = suppressFiltering; > >@@ -624,6 +626,38 @@ WI.NavigationSidebarPanel = class NavigationSidebarPanel extends WI.SidebarPanel > this._updateContentOverflowShadowVisibilityDebouncer.delayForTime(0); > } > >+ _treeElementRevealed(event) >+ { >+ let treeElement = event.data.element; >+ let treeOutline = treeElement.treeOutline; >+ if (!treeOutline) >+ return; >+ >+ let detailsSection = null; >+ let parent = treeOutline.element.parentNode; >+ while (parent) { >+ if (parent.__detailsSection) { >+ detailsSection = parent.__detailsSection; >+ break; >+ } >+ parent = parent.parentNode; >+ } >+ >+ console.assert(!detailsSection || detailsSection instanceof WI.DetailsSection); >+ if (!detailsSection) >+ return; >+ >+ // Revealing a TreeElement at the scroll container's topmost edge with >+ // scrollIntoViewIfNeeded may result in the element being covered by the >+ // DetailsSection header, which uses sticky positioning. Detect this case, >+ // and adjust the sidebar content's scroll position to compensate. >+ let headerRect = detailsSection.headerElement.getBoundingClientRect(); >+ let treeElementRect = treeElement.listItemElement.getBoundingClientRect(); >+ let topOffset = headerRect.bottom - treeElementRect.top; >+ if (topOffset > 0) >+ this.scrollElement.scrollBy(0, -topOffset); >+ } >+ > _checkForStaleResourcesIfNeeded() > { > if (!this._checkForStaleResourcesTimeoutIdentifier || !this._shouldAutoPruneStaleTopLevelResourceTreeElements) >diff --git a/Source/WebInspectorUI/UserInterface/Views/TreeElement.js b/Source/WebInspectorUI/UserInterface/Views/TreeElement.js >index 63c27b8f1608094a36477ee4fa042f75669e1661..f6ae0469dc0b193daa9b22cee75f5efc3377716b 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/TreeElement.js >+++ b/Source/WebInspectorUI/UserInterface/Views/TreeElement.js >@@ -488,6 +488,9 @@ WI.TreeElement = class TreeElement extends WI.Object > > if (this.onreveal) > this.onreveal(this); >+ >+ if (this.treeOutline) >+ this.treeOutline.dispatchEventToListeners(WI.TreeOutline.Event.ElementRevealed, {element: this}); > } > > revealed(ignoreHidden) >diff --git a/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js b/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js >index 66ecd52bb8f3391cc3732f08001bed6c4f42ec41..654eb57d4e6e723a209a6aa29dca1f4590b0aa63 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js >+++ b/Source/WebInspectorUI/UserInterface/Views/TreeOutline.js >@@ -1162,6 +1162,7 @@ WI.TreeOutline.Event = { > ElementClicked: Symbol("element-clicked"), > ElementDisclosureDidChanged: Symbol("element-disclosure-did-change"), > ElementVisibilityDidChange: Symbol("element-visbility-did-change"), >+ ElementRevealed: Symbol("element-revealed"), > SelectionDidChange: Symbol("selection-did-change") > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198228
:
370582
|
370982
|
371162
|
371165
|
371166