Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3d8f24ebaa465aa3562f4b8f4e6d7cfded19c589
      
https://github.com/WebKit/WebKit/commit/3d8f24ebaa465aa3562f4b8f4e6d7cfded19c589
  Author: Ryosuke Niwa <[email protected]>
  Date:   2026-04-27 (Mon, 27 Apr 2026)

  Changed paths:
    M LayoutTests/http/wpt/service-workers/third-party-registration.html
    M LayoutTests/platform/ios-site-isolation/TestExpectations
    M LayoutTests/platform/mac-site-isolation/TestExpectations
    M Source/WebCore/loader/DocumentLoader.cpp

  Log Message:
  -----------
  [Site Isolation] http/wpt/service-workers/third-party-registration.html fails
https://bugs.webkit.org/show_bug.cgi?id=313463

Reviewed by Brady Eidson.

In DocumentLoader::commitData(), setServiceWorkerConnection() (line 1356) 
triggers
ServiceWorkerClientData::from(), which collects ancestorOrigins by traversing
frame->tree().parent(). Under site isolation, the iframe is a provisional frame
created with AddToFrameTree::No, so tree().parent() returns null. The frame only
gets its correct parent later when receivedFirstData() (line 1368) triggers
commitProvisionalFrame() -> parent->tree().replaceChild().

The fix: After receivedFirstData() commits the provisional frame into the tree,
call updateServiceWorkerClientData() to re-register the service worker client 
with
correct ancestor origins. SWServer::registerServiceWorkerClient already handles
re-registration by updating the stored data via m_clientsById.set().

Also improve the logging in the test for easier debugging.

Co-authored with Claude.

Test: LayoutTests/http/wpt/service-workers/third-party-registration.html

* LayoutTests/http/wpt/service-workers/third-party-registration.html:
* LayoutTests/platform/ios-site-isolation/TestExpectations:
* LayoutTests/platform/mac-site-isolation/TestExpectations:
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):

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



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

Reply via email to