Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a76e340b35bc50788d5cdea53a31a425496882e5
https://github.com/WebKit/WebKit/commit/a76e340b35bc50788d5cdea53a31a425496882e5
Author: Andy Estes <[email protected]>
Date: 2024-08-31 (Sat, 31 Aug 2024)
Changed paths:
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
M Source/WebCore/dom/FullscreenManager.cpp
M Source/WebCore/html/HTMLMediaElement.cpp
M Source/WebCore/html/HTMLVideoElement.cpp
M Source/WebCore/page/Page.cpp
M Source/WebCore/page/Page.h
M Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
M Source/WebKit/Shared/WebPreferencesDefaultValues.h
M Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
M Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/WebFullScreenManagerProxy.messages.in
M Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp
M Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h
M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLifecycle.mm
Log Message:
-----------
Cannot use element fullscreen for video fullscreen when Fullscreen API is
disabled
https://bugs.webkit.org/show_bug.cgi?id=278796
rdar://134863159
Reviewed by Jer Noble and Ryosuke Niwa.
Clients that enable the VideoFullscreenRequiresElementFullscreen preference use
the element
fullscreen infrastructure to implement video fullscreen by making the <video>
element the
fullscreen element and rendering WebKit's built-in media controls. However,
this mechanism does
not work in clients that choose not to expose the Fullscreen API to websites
(by disabling the
FullScreenEnabled preference).
It should still be possible to enter video fullscreen (via element fullscreen)
in clients that
disable the Fullscreen API, so this change makes it so by supporting internal
calls to
FullscreenManager::requestFullscreenForElement() when either the
VideoFullscreenRequiresElementFullscreen or FullScreenEnabled preferences are
enabled.
Added an API test.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
Changed the conditional for VideoFullscreenRequiresElementFullscreen to
ENABLE(FULLSCREEN_API)
and moved the default value setter to here from WKWebView.mm.
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::requestFullscreenForElement):
(WebCore::FullscreenManager::willEnterFullscreen):
Used Page::isFullscreenManagerEnabled() to check if it's possible to enter
element fullscreen.
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::videoUsesElementFullscreen const):
Simplified compile-time conditionals.
(WebCore::HTMLMediaElement::enterFullscreen):
Used Page::isFullscreenManagerEnabled() to check if it's possible to enter
element fullscreen.
(WebCore::HTMLMediaElement::exitFullscreen):
Removed the unnecessary fullScreenEnabled() check, since we couldn't have a
currentFullscreenElement() if the feature weren't enabled.
* Source/WebCore/html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::supportsFullscreen const):
Simplified compile-time conditionals.
* Source/WebCore/page/Page.cpp:
(WebCore::Page::isFullscreenManagerEnabled const):
* Source/WebCore/page/Page.h:
Added. Returns true if VideoFullscreenRequiresElementFullscreen or
FullScreenEnabled are enabled.
* Source/WebKit/Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultVideoFullscreenRequiresElementFullscreen):
* Source/WebKit/Shared/WebPreferencesDefaultValues.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setupPageConfiguration:withPool:]):
Set VideoFullscreenRequiresElementFullscreen to true by default on
supported platforms.
* Source/WebKit/UIProcess/WebFullScreenManagerProxy.messages.in:
Enabled IPC messages if VideoFullscreenRequiresElementFullscreen or
FullScreenEnabled are enabled.
* Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::supportsFullScreenForElement):
(WebKit::WebFullScreenManager::supportsFullScreen): Deleted.
* Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::supportsFullScreenForElement):
Used Page::isFullscreenManagerEnabled() to check if it's possible to enter
element fullscreen.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLifecycle.mm:
(runTest):
(TEST(Fullscreen, VideoLifecycle)):
(TEST(Fullscreen, VideoLifecycleElementFullscreenDisabled)):
Added an API test.
Canonical link: https://commits.webkit.org/283033@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