Bug 315583

Summary: Web Inspector: node highlight in object preview can diverge from preview text after the object is mutated
Product: WebKit Reporter: Alice Tang <tang.alice.000>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: hi, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=143206

Alice Tang
Reported 2026-05-26 11:20:46 PDT
When hovering a DOM node in an object preview, the node is resolved live at hover time (arrays and plain objects via getProperty, collections via getCollectionEntries). If the object has been mutated since the preview was generated, the highlighted node won't match what the preview text shows. For example: let map = new Map([["a", document.body.children[0]]]); console.log(map); map.set("a", document.body.children[1]); // hovering the "a" entry now highlights children[1] even though the // preview still shows children[0] This affects all preview types, not just collections. The root issue is that there's no direct link between a preview entry and the specific object that was snapshotted when the preview was generated. The fix is probably to bind a RemoteObjectId to node entries at preview generation time, either by adding an optional objectId to Runtime.ObjectPreview or via a new parameter on Runtime.getPreview and commands that take generatePreview. That way hovering can resolve directly to the snapshotted object rather than refetching by name or index. Multiple RemoteObjectIds mapping to the same value should already be fine given how RemoteObjects work today. See Also: https://bugs.webkit.org/show_bug.cgi?id=143206
Attachments
Alice Tang
Comment 1 2026-05-26 13:50:20 PDT
Note You need to log in before you can comment on or make changes to this bug.