Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ba29ff41e0a023bd1c7d3e64d4c35cc20046efbf
https://github.com/WebKit/WebKit/commit/ba29ff41e0a023bd1c7d3e64d4c35cc20046efbf
Author: Remy Demarest <[email protected]>
Date: 2026-08-25 (Tue, 25 Aug 2026)
Changed paths:
M Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h
M Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SOAuthorizationTests.mm
Log Message:
-----------
SOAuthorizationSession should allow the client to present the authorization
view controller via its own view controller on macOS
https://bugs.webkit.org/show_bug.cgi?id=322459
Reviewed by Alex Christensen.
Currently, SOAuthorizationSession presents its authorization view controller
by creating and managing its own NSWindow on macOS. This means the client
(e.g. Safari) has no way to present the authorization UI within its own
window/view hierarchy, such as a sheet on an existing browser window.
Allow the client to opt in to presenting the authorization view controller
itself by supplying a view controller via the UI client
(WKUIDelegatePrivate._presentingViewControllerForWebView:). When a
client-provided view controller is available, present the authorization
view controller as a sheet on it instead of creating a new NSWindow, and
dismiss it the same way when the session ends.
Add a unit test verifying that the SOAuthorization view controller is presented
as a child of the client-supplied view controller instead of a WebKit provided
window.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SOAuthorizationTests.mm
* Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.h:
* Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationSession.mm:
(WebKit::SOAuthorizationSession::presentViewController):
(WebKit::SOAuthorizationSession::dismissViewController):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SOAuthorizationTests.mm:
(-[TestSOAuthorizationDelegate _presentingViewControllerForWebView:]):
(TestWebKitAPI::TEST(SOAuthorizationRedirect,
InterceptionSucceedWithUIViaPresentingViewController)):
Canonical link: https://commits.webkit.org/319838@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications