Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c432535e2dd2f474007a2398f0156106eb87ed0e
      
https://github.com/WebKit/WebKit/commit/c432535e2dd2f474007a2398f0156106eb87ed0e
  Author: Anuj Panta <[email protected]>
  Date:   2026-07-22 (Wed, 22 Jul 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/inspector/dom/custom-elements-and-pseudo-elements-frame-target-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/dom/custom-elements-and-pseudo-elements-frame-target.html
    A 
LayoutTests/http/tests/site-isolation/inspector/dom/resources/custom-elements-and-pseudo-elements-frame.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] [Site Isolation] Deliver DOM custom-element and 
pseudo-element events to Frame Targets
https://bugs.webkit.org/show_bug.cgi?id=NNNNNN
rdar://179176056

Reviewed by Qianlang Chen.

Web Inspector's Elements tree for an out-of-process iframe went
stale on these lifecycle changes:

- DOM.customElementStateChanged
- DOM.pseudoElementAdded
- DOM.pseudoElementRemoved

They were stubbed off at every layer for the frame target: the protocol declared
them "page"-only, InspectorInstrumentation routed them only to the page-level
persistentDOMAgent(), and the frontend DOMObserver early-returned with a FIXME
for FrameTarget. FrameDOMAgent already had complete, correct implementations of
all three methods, so this is a pure wiring change, not a new feature.

This adds the missing routing following the existing convention used by
didInsertDOMNode / didModifyDOMAttr (notify the frame's own FrameDOMAgent, then
the page agent), declares the events for the frame target, and adds the
scoped-id frontend handlers so the iframe's Elements tree stays live.

The added layout test deliberately covers multiple, repeated, and interleaved
scenarios rather than a single event per type, since these handlers manage
per-node and per-pseudo-type state: two custom elements upgraded back-to-back
(no cross-contamination), ::before and ::after coexisting, targeted 
single-pseudo
removal leaving the sibling intact, and an add/remove/re-add cycle guarding
against stale-node leaks. It also documents that one upgrade legitimately emits
two transitions (FailedOrPrecustomized then Custom), which the frame target
relays just like the page target.

Test: 
http/tests/site-isolation/inspector/dom/custom-elements-and-pseudo-elements-frame-target.html

* 
LayoutTests/http/tests/site-isolation/inspector/dom/custom-elements-and-pseudo-elements-frame-target-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/dom/custom-elements-and-pseudo-elements-frame-target.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/dom/resources/custom-elements-and-pseudo-elements-frame.html:
 Added.
* Source/JavaScriptCore/inspector/protocol/DOM.json:
* Source/WebCore/inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didChangeCustomElementStateImpl):
(WebCore::InspectorInstrumentation::pseudoElementCreatedImpl):
(WebCore::InspectorInstrumentation::pseudoElementDestroyedImpl):
* Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js:
(WI.DOMManager.prototype._frameTargetCustomElementStateChanged):
(WI.DOMManager.prototype._frameTargetPseudoElementAdded):
(WI.DOMManager.prototype._frameTargetPseudoElementRemoved):
* Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js:
(WI.DOMObserver.prototype.customElementStateChanged):
(WI.DOMObserver.prototype.pseudoElementAdded):
(WI.DOMObserver.prototype.pseudoElementRemoved):

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



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

Reply via email to