Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 034bf10318cda0200ec8efc019bca8c0202da9e8
https://github.com/WebKit/WebKit/commit/034bf10318cda0200ec8efc019bca8c0202da9e8
Author: Anuj Panta <[email protected]>
Date: 2026-07-22 (Wed, 22 Jul 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/inspector/dom/resources/shadow-root-child-frame.html
A
LayoutTests/http/tests/site-isolation/inspector/dom/resources/shadow-root-frame.html
A
LayoutTests/http/tests/site-isolation/inspector/dom/resources/shadow-root-grandchild-frame.html
A
LayoutTests/http/tests/site-isolation/inspector/dom/shadow-root-cross-frame-isolation-frame-target-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/dom/shadow-root-cross-frame-isolation-frame-target.html
A
LayoutTests/http/tests/site-isolation/inspector/dom/shadow-root-pushed-frame-target-expected.txt
A
LayoutTests/http/tests/site-isolation/inspector/dom/shadow-root-pushed-frame-target.html
M Source/JavaScriptCore/inspector/protocol/DOM.json
M Source/WebCore/inspector/InspectorInstrumentation.cpp
M Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
M Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js
Log Message:
-----------
Web Inspector: [SI] route shadowRootPushed/Popped to per-frame FrameDOMAgent
https://bugs.webkit.org/show_bug.cgi?id=X
rdar://179248483
Reviewed by Qianlang Chen.
Under Site Isolation a cross-origin iframe's DOM lives in a separate
WebProcess with its own FrameDOMAgent. The DOM.shadowRootPushed and
shadowRootPopped events are fired through InstrumentingAgents, which only
notified the page-level agent, so attaching a shadow root inside a cross-
origin iframe reached no agent for that frame -- and even when it did, the
frontend dropped it for a FrameTarget. The shadow root never appeared in the
Elements tree.
didPushShadowRootImpl and willPopShadowRootImpl now resolve the host's frame
and notify that frame's persistentFrameDOMAgent before falling through to the
page agent, matching the branch already used by the sibling per-node hooks
(didModifyDOMAttr, didInsertDOMNode). The main frame has no
persistentFrameDOMAgent and the page agent's boundNodeId() guard suppresses
subframe hosts, so there is no double-fire. DOM.json widens both events'
targetTypes from ["page"] to ["frame","page"] so the generated dispatcher
accepts them from a FrameTarget; FrameDOMAgent already implemented
didPushShadowRoot/willPopShadowRoot.
On the frontend, DOMObserver replaces the two FrameTarget FIXME early-returns
with _frameTargetShadowRootPushed/_frameTargetShadowRootPopped, modeled on
_frameTargetChildNodeInserted/Removed. They scope the shadow-root WI.DOMNode
to the owning frame target (target.identifier + ":" + nodeId) so colliding
raw NodeIds across frames stay distinct.
shadowRootPopped is wired but has no end-to-end test: author shadow roots have
no scriptable detach, so willPopShadowRoot only fires on host destruction, and
removing the host first unbinds the root (FrameDOMAgent::unbind), leaving
boundNodeId 0 so the backend suppresses the event.
Tests:
http/tests/site-isolation/inspector/dom/shadow-root-cross-frame-isolation-frame-target.html
http/tests/site-isolation/inspector/dom/shadow-root-pushed-frame-target.html
*
LayoutTests/http/tests/site-isolation/inspector/dom/resources/shadow-root-child-frame.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/resources/shadow-root-frame.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/resources/shadow-root-grandchild-frame.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/shadow-root-cross-frame-isolation-frame-target-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/shadow-root-cross-frame-isolation-frame-target.html:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/shadow-root-pushed-frame-target-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/inspector/dom/shadow-root-pushed-frame-target.html:
Added.
* Source/JavaScriptCore/inspector/protocol/DOM.json:
* Source/WebCore/inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didPushShadowRootImpl):
(WebCore::InspectorInstrumentation::willPopShadowRootImpl):
* Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype._frameTargetShadowRootPushed):
(WI.DOMManager.prototype._frameTargetShadowRootPopped):
* Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js:
(WI.DOMObserver.prototype.shadowRootPushed):
(WI.DOMObserver.prototype.shadowRootPopped):
Canonical link: https://commits.webkit.org/317697@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications