Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d845346ddb6c21f345369b0095da6e519b3c6e8b
https://github.com/WebKit/WebKit/commit/d845346ddb6c21f345369b0095da6e519b3c6e8b
Author: Anuj Panta <[email protected]>
Date: 2026-07-02 (Thu, 02 Jul 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/dom/js-bridge-frame-target-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/dom/js-bridge-frame-target.html
M Source/JavaScriptCore/inspector/protocol/DOM.json
M Source/WebCore/inspector/agents/frame/FrameDOMAgent.cpp
M Source/WebCore/inspector/agents/frame/FrameDOMAgent.h
M Source/WebCore/inspector/agents/frame/FrameDOMAgentStubs.cpp
M Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
M Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js
Log Message:
-----------
Web Inspector: [SI] implement resolveNode / requestNode / setInspectedNode on
FrameDOMAgent
https://bugs.webkit.org/show_bug.cgi?id=316137
rdar://178562399
Reviewed by Qianlang Chen.
Port the JS bridge commands onto FrameDOMAgent. resolveNode wraps a
frame node in a RemoteObject via the frame's WebInjectedScriptManager
and main-world global. requestNode walks an objectId back to a Node
through the same manager. setInspectedNode registers the node with
the frame's CommandLineAPIHost so $0 resolves to it inside that
frame's console context.
On the frontend, WI.RemoteObject.resolveNode and
WI.DOMManager.setInspectedNode route through `owningTarget ||
WI.assumingMainTarget()` with `backendNodeId`. pushNodeToFrontend
takes an optional target threaded from the originating RemoteObject
so the requestNode lookup hits the agent that owns the objectId.
Selecting a cross-origin iframe node in Elements no longer logs
"Cannot resolve node" errors, the Properties sidebar populates, and
$0 in the iframe's console context resolves to the inspected node.
Test: http/tests/site-isolation/inspector/dom/js-bridge-frame-target.html
*
LayoutTests/http/tests/site-isolation/inspector/dom/js-bridge-frame-target-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/js-bridge-frame-target.html:
Added.
* Source/JavaScriptCore/inspector/protocol/DOM.json:
* Source/WebCore/inspector/agents/frame/FrameDOMAgent.cpp:
(WebCore::FrameDOMAgent::willDestroyFrontendAndBackend):
(WebCore::FrameDOMAgent::setDocument):
(WebCore::FrameDOMAgent::resolveNodeInternal):
(WebCore::FrameDOMAgent::nodeForObjectId):
(WebCore::FrameDOMAgent::resolveNode):
(WebCore::FrameDOMAgent::requestNode):
(WebCore::FrameDOMAgent::setInspectedNode):
* Source/WebCore/inspector/agents/frame/FrameDOMAgent.h:
* Source/WebCore/inspector/agents/frame/FrameDOMAgentStubs.cpp:
(WebCore::FrameDOMAgent::requestNode): Deleted.
(WebCore::FrameDOMAgent::resolveNode): Deleted.
(WebCore::FrameDOMAgent::setInspectedNode): Deleted.
* Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype.pushNodeToFrontend):
(WI.DOMManager.prototype.setInspectedNode):
* Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js:
(WI.RemoteObject.resolveNode):
(WI.RemoteObject.prototype.pushNodeToFrontend):
Canonical link: https://commits.webkit.org/316367@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications