Skip to content
Browse files
Web Inspector: Computed tab scrolls back to top when <style> is added…
… to page

Reviewed by Patrick Angle.

`WI.GeneralStyleDetailsSidebarPanel` forces a full layout of `WI.ComputedStyleDetailsPanel`,
`WI.SpreadsheetRulesStyleDetailsPanel`, and `WI.FontDetailsPanel` when adding or removing a
stylesheet. This is also resets their scroll position.

The full layout is unnecessary. The panels update their contents in reaction to the
`WI.DOMNodeStyles.Event.NeedsRefresh` event from the selected node and ensure the
scroll position is preserved in `WI.StyleDetailsPanel._refreshPreservingScrollPosition()`.

* Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:

Canonical link:
  • Loading branch information
rcaliman-apple committed Sep 29, 2022
1 parent 91710de commit 94fb9bb96d6a72ffedacc547d913d00efff91838
Showing 1 changed file with 5 additions and 1 deletion.
@@ -432,7 +432,11 @@ WI.GeneralStyleDetailsSidebarPanel = class GeneralStyleDetailsSidebarPanel exten

let domNode = this.domNode;
if (!domNode || domNode.destroyed)


0 comments on commit 94fb9bb

Please sign in to comment.