RESOLVED FIXED 189569
Web Inspector: Opening inspector with a selected element might immediately scroll that element off screen in the DOM Tree outline
https://bugs.webkit.org/show_bug.cgi?id=189569
Summary Web Inspector: Opening inspector with a selected element might immediately sc...
Joseph Pecoraro
Reported 2018-09-12 17:00:13 PDT
Opening inspector with a selected element might immediately scroll that element off screen in the DOM Tree outline Steps to Reproduce: 1. Open https://www.apple.com/iphone-xs/ 2. Scroll down 3. Select some text 4. Context menu > Inspect Element => Web Inspector opens, but that element is not visible (you need to scroll down in the DOM Tree in the Elements tab) Notes: - Watching in slow motion, the tab opens, element is selected, then the sidebar opens, the tree lays out and the selected element is pushed down.
Attachments
[PATCH] Proposed Fix (2.60 KB, patch)
2018-09-12 17:01 PDT, Joseph Pecoraro
joepeck: review-
joepeck: commit-queue-
Archive of layout-test-results from ews106 for mac-sierra-wk2 (3.54 MB, application/zip)
2018-09-12 21:29 PDT, EWS Watchlist
no flags
[PATCH] Proposed Fix (1.68 KB, patch)
2018-09-13 10:24 PDT, Joseph Pecoraro
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.42 MB, application/zip)
2018-09-13 12:23 PDT, EWS Watchlist
no flags
Joseph Pecoraro
Comment 1 2018-09-12 17:00:23 PDT
Joseph Pecoraro
Comment 2 2018-09-12 17:01:32 PDT
Created attachment 349597 [details] [PATCH] Proposed Fix I want to live on this for a while to make sure it doesn't cause any unexpected problems.
Devin Rousso
Comment 3 2018-09-12 21:15:56 PDT
Comment on attachment 349597 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=349597&action=review > Source/WebInspectorUI/UserInterface/Views/ElementsTabContentView.js:44 > + WI.detailsSidebar.addEventListener(WI.Sidebar.Event.CollapsedStateDidChange, this._elementsTabDetailsSidebarCollapsedStateDidChange, this); I think we might also want to re-scroll the node if the sidebar's width changes too, not just if it collapses. You should be able to modify `WI.DOMTreeContentView.prototype.layout`: if (this.layoutReason === WI.View.LayoutReason.Resize) this._domTreeOutline.selectDOMNode(this._domTreeOutline.selectedDOMNode());
EWS Watchlist
Comment 4 2018-09-12 21:29:17 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 5 2018-09-12 21:29:18 PDT Comment hidden (obsolete)
Joseph Pecoraro
Comment 6 2018-09-13 10:20:36 PDT
Comment on attachment 349597 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=349597&action=review >> Source/WebInspectorUI/UserInterface/Views/ElementsTabContentView.js:44 >> + WI.detailsSidebar.addEventListener(WI.Sidebar.Event.CollapsedStateDidChange, this._elementsTabDetailsSidebarCollapsedStateDidChange, this); > > I think we might also want to re-scroll the node if the sidebar's width changes too, not just if it collapses. You should be able to modify `WI.DOMTreeContentView.prototype.layout`: > > if (this.layoutReason === WI.View.LayoutReason.Resize) > this._domTreeOutline.selectDOMNode(this._domTreeOutline.selectedDOMNode()); Great idea!
Joseph Pecoraro
Comment 7 2018-09-13 10:24:27 PDT
Created attachment 349677 [details] [PATCH] Proposed Fix
EWS Watchlist
Comment 8 2018-09-13 12:23:18 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 9 2018-09-13 12:23:20 PDT Comment hidden (obsolete)
Devin Rousso
Comment 10 2018-09-13 16:33:00 PDT
Comment on attachment 349677 [details] [PATCH] Proposed Fix r=me
WebKit Commit Bot
Comment 11 2018-09-13 16:58:48 PDT
Comment on attachment 349677 [details] [PATCH] Proposed Fix Clearing flags on attachment: 349677 Committed r235996: <https://trac.webkit.org/changeset/235996>
WebKit Commit Bot
Comment 12 2018-09-13 16:58:50 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.