Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b17e57d6d9bea2b11d640a92ba7f57f95ca10161
https://github.com/WebKit/WebKit/commit/b17e57d6d9bea2b11d640a92ba7f57f95ca10161
Author: Youenn Fablet <[email protected]>
Date: 2024-09-09 (Mon, 09 Sep 2024)
Changed paths:
M Source/WebCore/loader/DocumentLoader.cpp
M Source/WebCore/loader/DocumentLoader.h
M Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm
Log Message:
-----------
ServiceWorkerClient.focus should resolve once the document event loop is
running
https://bugs.webkit.org/show_bug.cgi?id=279263
rdar://problem/135408068
Reviewed by Ben Nham.
https://w3c.github.io/ServiceWorker/#client-focus says to queue a task on the
document to focus to execute some steps, and then resolve the focus promise.
We are not ensuring this, and it may have an impact in case the document is not
yet created or if its event loop is not yet running.
For that reason, we are now focusing the navigable and, once done and once the
document is created, wwe enqueue a task on the document to do the focus step
and trigger the focus promise resolution.
Covered by updated API test.
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::~DocumentLoader):
(WebCore::DocumentLoader::mainReceivedError):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::whenDocumentIsCreated):
* Source/WebCore/loader/DocumentLoader.h:
* Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::focusServiceWorkerClient):
(WebKit::WebSWClientConnection::addCookieChangeSubscriptions):
(WebKit::WebSWClientConnection::removeCookieChangeSubscriptions):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
((ServiceWorker, FocusNotYetLoadedClient)):
Canonical link: https://commits.webkit.org/283337@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes