-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In in-window mode, missing PIP when minimizing safari
https://bugs.webkit.org/show_bug.cgi?id=275182 rdar://124376686 Reviewed by Jer Noble. Currently when a window is in in-window mode and the safari window is minimized, safari asks webkit to toggle PIP, but this does not successfully occur. This is because currently we return early from HTMLMediaElement::enterFullscreen if the document hidden. This check has been changed to not return early if the document is the new mode is PIP. The above change revealed that we do not successfully return to in-window mode when the window is maximized again, or when the PIP return button is clicked. To fix the case where the window is maximized but the video does not return to in-window, this patch has us no longer return early from FullscreenManager::requestFullscreenForElement when the document is hidden but the new mode is in-window. To fix the case where the the return button is clicked on the PIP window and the video does not return to in-window, this patch has VideoPresentationInterfaceMac wait for the document to become visible before beginning to exit PIP. To facilitate this, VideoPresentationModelVideoElement now listens to visibilitychangeEvent from Document and propagates the information to VideoPresentationInterfaceMac. * Source/WebCore/dom/FullscreenManager.cpp: (WebCore::FullscreenManager::requestFullscreenForElement): * Source/WebCore/html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): * Source/WebCore/platform/cocoa/VideoPresentationModel.h: (WebCore::VideoPresentationModelClient::documentVisibilityChanged): * Source/WebCore/platform/cocoa/VideoPresentationModelVideoElement.h: * Source/WebCore/platform/cocoa/VideoPresentationModelVideoElement.mm: (WebCore::VideoPresentationModelVideoElement::setVideoElement): (WebCore::VideoPresentationModelVideoElement::updateForEventName): (WebCore::VideoPresentationModelVideoElement::documentVisibilityChanged): (WebCore::VideoPresentationModelVideoElement::documentObservedEventNames): * Source/WebCore/platform/mac/VideoPresentationInterfaceMac.h: * Source/WebCore/platform/mac/VideoPresentationInterfaceMac.mm: (WebCore::VideoPresentationInterfaceMac::requestHideAndExitPiP): (WebCore::VideoPresentationInterfaceMac::documentVisibilityChanged): * Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.h: * Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.messages.in: * Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm: (WebKit::VideoPresentationManagerProxy::setDocumentVisibility): * Source/WebKit/WebProcess/cocoa/VideoPresentationManager.h: * Source/WebKit/WebProcess/cocoa/VideoPresentationManager.mm: (WebKit::VideoPresentationInterfaceContext::documentVisibilityChanged): (WebKit::VideoPresentationManager::documentVisibilityChanged): Canonical link: https://commits.webkit.org/279877@main
- Loading branch information
Showing
12 changed files
with
86 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters