Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3e346bcca08ac8561830d93a36270aad848e3903
      
https://github.com/WebKit/WebKit/commit/3e346bcca08ac8561830d93a36270aad848e3903
  Author: Dana Estra <des...@apple.com>
  Date:   2024-07-28 (Sun, 28 Jul 2024)

  Changed paths:
    M Source/WebKit/WebProcess/cocoa/VideoPresentationManager.mm

  Log Message:
  -----------
  Viewer: Switching tabs while exiting pip crashes web content process
https://bugs.webkit.org/show_bug.cgi?id=277178
rdar://132494825

Reviewed by Jer Noble.

This crash is caused by the IPC message check inside 
VideoPresentationManagerProxy::setupFullscreenWithID:

MESSAGE_CHECK(videoFullscreenMode == 
HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)

This message check is failing because we are passing in 
VideoFullscreenModeInWindow as the new mode to
VideoPresentationManager::enterVideoFullscreenForVideoElement, which is called 
from
VideoPresentationManager::didCleanupFullscreen. We should have 
didCleanupFullscreen return early if the
mode is inWindow, which is what we do when the mode is inline.

Returning from didCleanupFullscreen before we call 
enterVideoFullscreenForVideoElement whenever the mode is
inWindow should not cause a regression because when we are normally 
transitioning from pip to inWindow/Viewer,
we return early from didCleanupFullscreen before calling 
enterVideoFullscreenForVideoElement. But because
of this specific case where we are interrupting the transition from pip to 
viewer by reentering pip,
the variable targetIsInFullscreen is not the expected value of false, which 
would normally have didCleanupFullscreen
return early. We cannot rely on this boolean being false in this case so we 
must explicitly return early
whenever the mode is inWindow.

* Source/WebKit/WebProcess/cocoa/VideoPresentationManager.mm:
(WebKit::VideoPresentationManager::didCleanupFullscreen):

Canonical link: https://commits.webkit.org/281480@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

Reply via email to