Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ff1dba6c2cbb523a62640d2a0ac94fefdd3ab366
      
https://github.com/WebKit/WebKit/commit/ff1dba6c2cbb523a62640d2a0ac94fefdd3ab366
  Author: Brandon Stewart <[email protected]>
  Date:   2026-06-17 (Wed, 17 Jun 2026)

  Changed paths:
    A 
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-cross-origin-frame-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-cross-origin-frame-rename-expected.txt
    A 
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-cross-origin-frame-rename.html
    A 
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-cross-origin-frame.html
    A 
LayoutTests/http/tests/site-isolation/inspector/page/resources/rename-then-navigate-frame.html
    M Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp

  Log Message:
  -----------
  [Site Isolation] Show cross-origin frames in the inspector frame model (Page 
live events)
https://bugs.webkit.org/show_bug.cgi?id=316666
rdar://179117404

Reviewed by BJ Burg.

With live Page.frameNavigated/frameDetached now flowing from cross-origin 
processes to
the UIProcess ProxyingPageAgent and on to the frontend, the frontend's existing
NetworkManager.frameDidNavigate/frameDidDetach handlers already integrate 
cross-origin
frames into WI.networkManager.frames -- no frontend changes are needed. Two 
UIProcess-side
bugs prevented the frame from showing up correctly, both fixed in 
ProxyingPageAgent:

1. The frame name was empty for a cross-origin child. Its live frameNavigated 
fires in the
   child's own process, where the owning <iframe> element is remote 
(frame.ownerElement()
   is null), so PageAgentProxy can't read the name attribute. Resolve it from 
the
   authoritative UIProcess WebFrameProxy tree (frameName()) when the event's 
name is empty,
   matching buildFrameTree(). Because the resolution reads the WebFrameProxy 
tree -- which
   tracks dynamic window.name changes under Site Isolation (via 
frameNameChanged) -- a
   renamed cross-origin child reports its updated name on its next 
frameNavigated.

2. A spurious frameDetached fired during a cross-origin process swap removed 
the live frame
   from the frontend. When the child swaps from its original process to a new 
one, the
   old process tears down its LocalFrame and fires frameDetached; by the time
   ProxyingPageAgent handles it, the frame's hosting process has already 
updated, so
   protocolFrameIdForFrameID() resolves it to the new (current) protocol id -- 
exactly the
   id the frontend just added via frameNavigated -- and frameDidDetach removed 
it. This was
   timing-dependent (only when the detach raced after the navigate). Suppress 
frameDetached
   when the frame is still present in the authoritative WebFrameProxy tree: 
that means it
   swapped processes rather than being removed. A genuine removal (frame gone 
from the tree)
   is still reported.

* Source/WebKit/UIProcess/Inspector/Agents/ProxyingPageAgent.cpp:
(Inspector::ProxyingPageAgent::frameNavigated):
Fill in the frame name from the WebFrameProxy tree when the event's name is 
empty.
(Inspector::ProxyingPageAgent::frameDetached):
Suppress the event when the frame is still in the WebFrameProxy tree 
(process-swap
artifact); only forward genuine removals.

* 
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-cross-origin-frame.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-cross-origin-frame-expected.txt:
 Added.
Assert a cross-origin child frame appears in WI.networkManager.frames with the 
correct
name/url/parent/origin under Site Isolation, and is not removed by the 
process-swap
frameDetached.

* 
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-cross-origin-frame-rename.html:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/page/network-manager-cross-origin-frame-rename-expected.txt:
 Added.
* 
LayoutTests/http/tests/site-isolation/inspector/page/resources/rename-then-navigate-frame.html:
 Added.
Assert a cross-origin child that changes its window.name and then navigates 
reports the
updated name in WI.networkManager.frames -- the live frameNavigated resolves 
the name from
the WebFrameProxy tree, which tracks the rename under Site Isolation.

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



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

Reply via email to