[webkit-changes] [WebKit/WebKit] 565dbe: -[WKWebView _canEnterFullscreen] can return YES fo...

aestes noreply at github.com
Thu Aug 22 16:14:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 565dbe7cbd923005f7a6c399977b325b6bfae891
      https://github.com/WebKit/WebKit/commit/565dbe7cbd923005f7a6c399977b325b6bfae891
  Author: Andy Estes <aestes at apple.com>
  Date:   2024-08-22 (Thu, 22 Aug 2024)

  Changed paths:
    M Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm
    M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h
    M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in
    M Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLifecycle.mm
    A Tools/TestWebKitAPI/Tests/WebKitLegacy/ios/fullscreen-lifecycle-audio.html

  Log Message:
  -----------
  -[WKWebView _canEnterFullscreen] can return YES for <audio> elements
https://bugs.webkit.org/show_bug.cgi?id=278085
rdar://131872096

Reviewed by Eric Carlson.

The (poorly) named -[WKWebView _enterFullscreen] method requires that the media element backing the
current controls manager interface be a <video> element, but -[WKWebView _canEnterFullscreen] would
return YES whenever there was a controls manager interface, regardless of the type of media element
backing it. This leads to a problem where -_enterFullscreen can silently fail even though
-_canEnterFullscreen returns YES. While in general it is possible for an <audio> element to have a
fullscreen presentation, not all platforms' media controls handle this case.

Addressed this (for now) by modifying -_canEnterFullscreen to only consider controls manager
interfaces for <video> elements when computing its value.

Added an API test.

* Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm:
(WebKit::PageClientImplCocoa::videoControlsManagerDidChange):
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
(WebKit::PlaybackSessionManagerProxy::canEnterVideoFullscreen const):
(WebKit::PlaybackSessionManagerProxy::hasControlsManagerInterface const): Deleted.
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in:
* Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
(WebKit::PlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
(WebKit::PlaybackSessionManagerProxy::clearPlaybackControlsManager):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::canEnterFullscreen):
* Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm:
(WebKit::PlaybackSessionManager::setUpPlaybackControlsManager):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/FullscreenLifecycle.mm:
(TEST(Fullscreen, AudioLifecycle)):
(TEST(Fullscreen, VideoLifecycle)):
(TEST(Fullscreen, Lifecycle)): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitLegacy/ios/fullscreen-lifecycle-audio.html: Added.

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



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


More information about the webkit-changes mailing list