Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 20b0d2d5de071e54fb873a539241cae9eeac9b11
      
https://github.com/WebKit/WebKit/commit/20b0d2d5de071e54fb873a539241cae9eeac9b11
  Author: Alice Tang <[email protected]>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Models/ObjectPreview.js
    M Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js

  Log Message:
  -----------
  Web Inspector: hovering over a node in a preview for a collection should 
highlight it
https://bugs.webkit.org/show_bug.cgi?id=143206
rdar://20341722

Reviewed by Devin Rousso.

Hovering over a DOM node in a collection preview (Set, Map) didn't
highlight it on the page (works fine for arrays).

Arrays render through `_appendPropertyPreviews`, which already handled
node entries with a `remoteObjectAccessor`. Collection entries went
through `_appendValuePreview` instead, which only provided an accessor
when rendering the top level object, never for individual entry sub
previews. Without an accessor, `createElementForNodePreview` has no way
to resolve the node, so it skips attaching the hover listeners entirely.

The fix adds `_appendCollectionEntryNodePreview`, which handles node
entries directly by calling `getCollectionEntries({fetchStart:
entryIndex, fetchCount: 1})` to fetch the live `RemoteObject` for that
specific entry and pass it as the accessor. Non-node entries fall
through to `_appendPreview` as before. WeakMap and WeakSet are excluded
because `fetchStart` has no effect on them, so positional lookup is
not reliable.

* Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js:
(WI.ObjectPreviewView.prototype._appendEntryPreviews):
(WI.ObjectPreviewView.prototype._appendCollectionEntryNodePreview):

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



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

Reply via email to