[webkit-changes] [WebKit/WebKit] 2cc2b7: In in-window mode, missing PIP when minimizing safari

Dana Estra noreply at github.com
Mon Jun 10 09:20:50 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2cc2b7b1a74870711aa5ffcac1ac77d890e95b6a
      https://github.com/WebKit/WebKit/commit/2cc2b7b1a74870711aa5ffcac1ac77d890e95b6a
  Author: Dana Estra <destra at apple.com>
  Date:   2024-06-10 (Mon, 10 Jun 2024)

  Changed paths:
    M Source/WebCore/dom/FullscreenManager.cpp
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/platform/cocoa/VideoPresentationModel.h
    M Source/WebCore/platform/cocoa/VideoPresentationModelVideoElement.h
    M Source/WebCore/platform/cocoa/VideoPresentationModelVideoElement.mm
    M Source/WebCore/platform/mac/VideoPresentationInterfaceMac.h
    M Source/WebCore/platform/mac/VideoPresentationInterfaceMac.mm
    M Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.h
    M Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.messages.in
    M Source/WebKit/UIProcess/Cocoa/VideoPresentationManagerProxy.mm
    M Source/WebKit/WebProcess/cocoa/VideoPresentationManager.h
    M Source/WebKit/WebProcess/cocoa/VideoPresentationManager.mm

  Log Message:
  -----------
  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



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