Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8f59f16cf4b93d0a66e2e442f4f26e90085a9012
      
https://github.com/WebKit/WebKit/commit/8f59f16cf4b93d0a66e2e442f4f26e90085a9012
  Author: Ryosuke Niwa <[email protected]>
  Date:   2026-04-29 (Wed, 29 Apr 2026)

  Changed paths:
    M Source/WebCore/Scripts/generate-process-sync-data.py
    M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
    M Source/WebKit/UIProcess/WebFrameProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/WebPage.messages.in

  Log Message:
  -----------
  Synchronize DocumentSyncData in WebPage::LoadDidCommitInAnotherProcess
https://bugs.webkit.org/show_bug.cgi?id=313530

Reviewed by Sihui Liu.

Implemented Sihui's review feedback from PR #63646 to sync the whole 
m_topDocumentSyncData
instead of just patching the URL during main frame process-swaps.

When a popup's main frame process-swaps (e.g., localhost to 127.0.0.1),
Page::setMainFrame(RemoteFrame) clears m_topDocumentSyncData, breaking origin 
partitioning
checks in clear-site-data/partitioning.html for example.

This PR does the following:
  1. Add a m_topDocumentSyncData cache to WebPageProxy, updated on every
     broadcastAllDocumentSyncData and broadcastDocumentSyncData
  2. During main frame process-swap, synthesizes a fresh DocumentSyncData with 
URL and
     SecurityOrigin from the committed request, and store it in WebPageProxy.
  3. The receiving WebContent process calls updateTopDocumentSyncData to set it 
atomically
     - no more clear-then-patch
  4. Subsequent broadcasts from the new process keep the cache updated

This PR also removes the failing expectation for 
http/wpt/clear-site-data/partitioning.html
since the test should be passing since 312181@main.

Co-authored with Claude.

Test: http/wpt/clear-site-data/partitioning.html

* Source/WebCore/Scripts/generate-process-sync-data.py:
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::didCommitLoadForFrame):
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::commitProvisionalFrame):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setTopDocumentSyncData):
(WebKit::WebPageProxy::broadcastDocumentSyncData):
(WebKit::WebPageProxy::broadcastAllDocumentSyncData):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadDidCommitInAnotherProcess):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:

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



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

Reply via email to