Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dd08cc4886525e32a953c8257b803a602e2b6ba5
      
https://github.com/WebKit/WebKit/commit/dd08cc4886525e32a953c8257b803a602e2b6ba5
  Author: Anuj Panta <[email protected]>
  Date:   2026-06-08 (Mon, 08 Jun 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/inspector/dom/dom-mutation-events-frame-target-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/dom/dom-mutation-events-frame-target.html
    A 
LayoutTests/http/tests/site-isolation/inspector/dom/resources/dom-mutation-frame.html
    M Source/WebCore/inspector/InspectorInstrumentation.cpp
    M Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
    M Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js

  Log Message:
  -----------
  Web Inspector: wire DOM tree mutation events to FrameDOMAgent for 
cross-origin iframes
https://bugs.webkit.org/show_bug.cgi?id=313550
rdar://175764777

Reviewed by Qianlang Chen.

The previous patch introduced FrameDOMAgent with DOM tree read support and
implemented mutation event handlers in the agent, but they were never called.
InspectorInstrumentation only routed to the page-level InspectorDOMAgent, so
cross-origin iframe DOM changes were invisible to the frontend

This patch wires 8 InspectorInstrumentation hooks to also reach FrameDOMAgent
via the node's owning frame: didInsertDOMNode, didRemoveDOMNode
willDestroyDOMNode, willModifyDOMAttr, didModifyDOMAttr, didRemoveDOMAttr,
characterDataModified, and didInvalidateStyleAttr.

On the frontend, DOMObserver's early-return guards for FrameTarget are replaced
with routing to new DOMManager frame-target handlers that resolve scoped node
IDs (targetId:nodeId) and dispatch the same events as the page-target path

The Elements panel now stays in sync with cross-origin iframe DOM changes in
real time — attribute modifications, text content changes, node
insertions/removals, and inline style invalidations all update live.

Test: 
http/tests/site-isolation/inspector/dom/dom-mutation-events-frame-target.html

* 
LayoutTests/http/tests/site-isolation/inspector/dom/dom-mutation-events-frame-target-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/dom/dom-mutation-events-frame-target.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/dom/resources/dom-mutation-frame.html:
 Added.
* Source/WebCore/inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didInsertDOMNodeImpl):
(WebCore::InspectorInstrumentation::didRemoveDOMNodeImpl):
(WebCore::InspectorInstrumentation::willDestroyDOMNodeImpl):
(WebCore::InspectorInstrumentation::willModifyDOMAttrImpl):
(WebCore::InspectorInstrumentation::didModifyDOMAttrImpl):
(WebCore::InspectorInstrumentation::didRemoveDOMAttrImpl):
(WebCore::InspectorInstrumentation::didInvalidateStyleAttrImpl):
(WebCore::InspectorInstrumentation::characterDataModifiedImpl):
* Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype._frameTargetAttributeModified):
(WI.DOMManager.prototype._frameTargetAttributeRemoved):
(WI.DOMManager.prototype._frameTargetInlineStyleInvalidated):
(WI.DOMManager.prototype._frameTargetCharacterDataModified):
(WI.DOMManager.prototype._frameTargetChildNodeCountUpdated):
(WI.DOMManager.prototype._frameTargetChildNodeInserted):
(WI.DOMManager.prototype._frameTargetChildNodeRemoved):
(WI.DOMManager.prototype._frameTargetWillDestroyDOMNode):
* Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js:
(WI.DOMObserver.prototype.attributeModified):
(WI.DOMObserver.prototype.attributeRemoved):
(WI.DOMObserver.prototype.inlineStyleInvalidated):
(WI.DOMObserver.prototype.characterDataModified):
(WI.DOMObserver.prototype.childNodeCountUpdated):
(WI.DOMObserver.prototype.childNodeInserted):
(WI.DOMObserver.prototype.childNodeRemoved):
(WI.DOMObserver.prototype.willDestroyDOMNode):

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



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

Reply via email to