Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5d04f53266d496ea905e8c770f5afa720bc1c254
      
https://github.com/WebKit/WebKit/commit/5d04f53266d496ea905e8c770f5afa720bc1c254
  Author: Rupin Mittal <[email protected]>
  Date:   2026-03-16 (Mon, 16 Mar 2026)

  Changed paths:
    M LayoutTests/platform/ios-site-isolation/TestExpectations
    M LayoutTests/platform/mac-site-isolation/TestExpectations
    M Source/WebKit/UIProcess/WebFrameProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp

  Log Message:
  -----------
  [Site Isolation] window-name-after-cross-origin-aux-frame-navigation.html is 
failing
https://bugs.webkit.org/show_bug.cgi?id=309915
rdar://172502670

Reviewed by Charlie Wolfe.

This test checks that if we use window.open to open a main frame, set a name on
the frame, then navigate that frame cross-site, it retains its name.

With site isolation enabled, this test fails because the frame loses its name.
Since we process swap, we create a new frame with a new frame tree. But we never
set this name on it.

With site isolation off, even though this is a cross-site navigation in the main
frame, we don't process swap because of this logic in
WebProcessPool::processForNavigationInternal:

if (navigation.openedByDOMWithOpener() && page.mainFrame() && 
(page.mainFrame()->opener() ..
    return { sourceProcess, nullptr, "Browsing context been opened by DOM 
without 'noopener'" };

So we continue to use the same frame and frame tree, which already has the name.

To fix this for site isolation, we ensure that when the name is set, we set it
on the WebFrameProxy as well. Later on, in order to create the new WebPage and
the new main frame, the WebPage will receive WebPageCreationParameters. This
contains the name that was held by WebFrameProxy and we can set it on the new
main frame.

The flow is:

1. JavaScript calls "window.name = <name>"
   --> LocalDOMWindow::setName
   --> WebPageProxy::frameNameChanged
2. Set the name on the WebFrameProxy
3. Call WebPage::create with WebPageCreationParameters
   (contains the frame name from WebFrameProxy::frameTreeCreationParameters)
4. Use this name for the new main frame

This also fixes window-name-after-cross-origin-sub-frame-navigation.html.

* LayoutTests/platform/ios-site-isolation/TestExpectations:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* Source/WebKit/UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::setSpecifiedName):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::frameNameChanged):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::create):
(WebKit::m_allowsImmersiveEnvironments):

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



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

Reply via email to