Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: f5ebbc5ed1246dc29ed91c1edb1b53810195074a https://github.com/WebKit/WebKit/commit/f5ebbc5ed1246dc29ed91c1edb1b53810195074a Author: Youenn Fablet <you...@apple.com> Date: 2024-05-31 (Fri, 31 May 2024)
Changed paths: M Source/WebKit/UIProcess/Cocoa/UIDelegate.h M Source/WebKit/UIProcess/Cocoa/UIDelegate.mm M Tools/TestWebKitAPI/Tests/WebKitCocoa/GetDisplayMedia.mm Log Message: ----------- [macOS Sonoma] [WKWebView] navigator.mediaDevices.getDisplayMedia() not working anymore as long as webView(_:requestMediaCapturePermissionFor:initiatedByFrame:type:decisionHandler:) gets implemented https://bugs.webkit.org/show_bug.cgi?id=274896 rdar://128988615 Reviewed by Eric Carlson. When no capture delegates are implemented, we rely on doing the capture request default action. For display capture, it will prompt the user to choose the capture surface. When adding a getUserMedia delegate, we no longer rely for getDisplayMedia on the default action. Instead we rely on using the getDisplayMedia private delegate or we deny the request otherwise. To fix this, we are now checking first whether the request is getUserMedia or getDisplayMedia. In the former case, we use the default action if there is no getUserMedia delegate. In the latter case, we use the default action if there is no getDisplayMedia delegate. Covered by added test. * Source/WebKit/UIProcess/Cocoa/UIDelegate.mm: (WebKit::isDelegateRespondingToDisplayCapturePermission): (WebKit::UIDelegate::UIClient::promptForDisplayCapturePermission): (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): * Tools/TestWebKitAPI/Tests/WebKitCocoa/GetDisplayMedia.mm: (-[MediaCaptureUIDelegate webView:requestMediaCapturePermissionForOrigin:initiatedByFrame:type:decisionHandler:]): (TestWebKitAPI::GetDisplayMediaTest::SetUp): (TestWebKitAPI::GetDisplayMediaTest::promptForCapture): (TestWebKitAPI::GetDisplayMediaTest::SetUpInternal): (TestWebKitAPI::GetDisplayMediaTest::hasDisplayCaptureDelegate const): (TestWebKitAPI::TEST_F): Canonical link: https://commits.webkit.org/279566@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes