Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 97a29a8fcc7f5db9385bd05361fa0ac1cd6700e0
      
https://github.com/WebKit/WebKit/commit/97a29a8fcc7f5db9385bd05361fa0ac1cd6700e0
  Author: Razvan Caliman <[email protected]>
  Date:   2025-12-10 (Wed, 10 Dec 2025)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Views/TreeOutline.js

  Log Message:
  -----------
  Web Inspector: Sources Navigation Sidebar is sometimes empty on page reload
https://bugs.webkit.org/show_bug.cgi?id=303833
rdar://166141968

Reviewed by Devin Rousso.

It's not guaranteed that a `WI.TreeElement.prototype._childrenListNode` will 
exist
when trying to append elements to it. It gets created when calling 
`WI.TreeOutline.prototype.expand()`,
but there are a few early return conditions where the element is marked as 
expanded,
while the necessary DOM subtree is not created because there aren't yet 
children to attach to it.

In the flurry of activity that happens on page reload, there are a few 
codepaths that attempt
to populate the resources tree outline as well as attempting to reveal the 
previously selected element.
See `WI.FrameTreeElement.prototype._mainResourceDidChange`.

Only when `WI.TreeElement.hasChildren` is set to true (which isn't the same as 
`WI.TreeElement.prototype.children.length`)
do the conditions get satisfied to create the DOM element _childrenListNode 
that other elements get appended to
in `WI.TreeOutline.prototype._updateVirtualizedElements()`.

There's a lot of layering violation going on across tree outline and tree 
elements
where private methods and objects get called across boundaries. And there is a 
lot
of state spread across multiple booleans that's difficult to reason about.
This warrants a refactoring, but for now, this patch unblocks other 
investigations
hampered by the unhandled exception.

* Source/WebInspectorUI/UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype._updateVirtualizedElements):

Canonical link: https://commits.webkit.org/304221@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to