Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: f720edf270760b6bdd4bb5be65a43e557d53817b https://github.com/WebKit/WebKit/commit/f720edf270760b6bdd4bb5be65a43e557d53817b Author: Andy Estes <aes...@apple.com> Date: 2025-06-10 (Tue, 10 Jun 2025)
Changed paths: M LayoutTests/media/video-presentation-mode-expected.txt M LayoutTests/media/video-presentation-mode.html M Source/WebCore/html/HTMLMediaElement.cpp M Source/WebCore/page/ChromeClient.h M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h M Source/WebKit/WebProcess/cocoa/VideoPresentationManager.h M Source/WebKit/WebProcess/cocoa/VideoPresentationManager.mm M Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h M Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm Log Message: ----------- REGRESSION (251714@main): video element's webkitPresentationMode remains 'picture-in-picture' when returning from PiP to fullscreen on iOS https://bugs.webkit.org/show_bug.cgi?id=294233 rdar://151050209 Reviewed by Eric Carlson. 251714@main made it so that only one video element could be in fullscreen at a time by storing an m_currentlyInFullscreen boolean on VideoPresentationManager that is set to true whenever a video element is in a VideoFullscreenMode other than VideoFullscreenModeNone. In HTMLMediaElement::enterFullscreen, if the new mode was VideoFullscreenModeStandard and m_currentlyInFullscreen was set, then we would abort entering fullscreen in order to prevent a second, overlapping fullscreen interface from being presented. However, this introduced a bug where we would incorrectly abort when returning from PiP to fullscreen, since in that case the new mode will be VideoFullscreenModeStandard and m_currentlyInFullscreen will be set. Fixed this by changing m_currentlyInFullscreen from a boolean to a VideoFullscreenMode named m_currentVideoFullscreenMode, and only aborting in HTMLMediaElement::enterFullscreen when the new mode matches the current mode (and the allowLayeredFullscreenVideos quirk is not active). This ensures that we can correctly transition between PiP, fullscreen, and in-window fullscreen modes. Modified LayoutTests/media/video-presentation-mode.html to cover the transition from PiP to fullscreen. * LayoutTests/media/video-presentation-mode-expected.txt: * LayoutTests/media/video-presentation-mode.html: * Source/WebCore/html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): * Source/WebCore/page/ChromeClient.h: (WebCore::ChromeClient::canEnterVideoFullscreen const): * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::canEnterVideoFullscreen const): * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h: * Source/WebKit/WebProcess/cocoa/VideoPresentationManager.h: * Source/WebKit/WebProcess/cocoa/VideoPresentationManager.mm: (WebKit::VideoPresentationManager::canEnterVideoFullscreen const): (WebKit::VideoPresentationManager::enterVideoFullscreenForVideoElement): (WebKit::VideoPresentationManager::exitVideoFullscreenForVideoElement): (WebKit::VideoPresentationManager::exitVideoFullscreenToModeWithoutAnimation): (WebKit::VideoPresentationManager::didCleanupFullscreen): (WebKit::VideoPresentationManager::setCurrentVideoFullscreenMode): (WebKit::VideoPresentationManager::setCurrentlyInFullscreen): Deleted. * Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h: * Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm: (WebChromeClient::canEnterVideoFullscreen const): Canonical link: https://commits.webkit.org/296041@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