WebKit Bugzilla
Attachment 360742 Details for
Bug 194099
: [Mac] Requesting PiP from two different WebViews gets PiP window "stuck"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194099-20190131104840.patch (text/plain), 4.27 KB, created by
Jer Noble
on 2019-01-31 10:48:40 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2019-01-31 10:48:40 PST
Size:
4.27 KB
patch
obsolete
>Subversion Revision: 240299 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6d889a09e72c001913f7cc848c1c7b3673bbf06b..470427a1e79ca75e8eabc4a30ce90a251fc4f117 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-01-31 Jer Noble <jer.noble@apple.com> >+ >+ [Mac] Requesting PiP from two different WebViews gets PiP window "stuck" >+ https://bugs.webkit.org/show_bug.cgi?id=194099 >+ <rdar://problem/47271323> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When a different client requests the PiP window, the PiP framework will call -pipDidClose: without >+ first calling -pipActionStop:. This leaves the internal fullscreen state in a confused state where >+ the WebView will attempt to re-enter PiP once it gets focus, and can lead to a state where the two >+ WebViews will constantly try to steal PiP from one another, ad infinitum. >+ >+ When receiving a notification that the PiP window closed when our internal state tells us that the >+ close was not requested, notify the client that PiP mode was exited, allowing them to set their >+ expected state to a correct and sane value. >+ >+ * platform/mac/VideoFullscreenInterfaceMac.mm: >+ (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]): >+ > 2019-01-28 Jer Noble <jer.noble@apple.com> > > webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic. >diff --git a/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm b/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm >index 1aa127e6b49cd5f4acd919e22c181f51200da30f..6e981d21cc560510fd5f6ca4fd7524d2b60366e8 100644 >--- a/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm >+++ b/Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm >@@ -287,7 +287,16 @@ - (void)pipDidClose:(PIPViewController *)pip > { > ASSERT_UNUSED(pip, pip == _pipViewController); > >- if (_videoFullscreenInterfaceMac && _videoFullscreenInterfaceMac->videoFullscreenModel() && _videoViewContainer && _returningWindow && !NSEqualRects(_returningRect, NSZeroRect)) { >+ if (!_videoFullscreenInterfaceMac) >+ return; >+ >+ if (_pipState != PIPState::ExitingPIP) { >+ // We got told to close without going through -pipActionStop, nor by exlicitly being asked to in -exitPiP:. >+ // Call -pipActionStop: here in order to set the fullscreen state to an expected value. >+ [self pipActionStop:pip]; >+ } >+ >+ if (_videoFullscreenInterfaceMac->videoFullscreenModel() && _videoViewContainer && _returningWindow && !NSEqualRects(_returningRect, NSZeroRect)) { > [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { > context.allowsImplicitAnimation = NO; > [_videoViewContainer setFrame:_returningRect]; >@@ -298,19 +307,17 @@ - (void)pipDidClose:(PIPViewController *)pip > } completionHandler:nil]; > } > >- if (_videoFullscreenInterfaceMac) { >- if (!self.isExitingToStandardFullscreen) { >- if (VideoFullscreenModel* videoFullscreenModel = _videoFullscreenInterfaceMac->videoFullscreenModel()) { >- videoFullscreenModel->didExitPictureInPicture(); >- videoFullscreenModel->setVideoLayerGravity(MediaPlayerEnums::VideoGravityResizeAspect); >- } >+ if (!self.isExitingToStandardFullscreen) { >+ if (VideoFullscreenModel* videoFullscreenModel = _videoFullscreenInterfaceMac->videoFullscreenModel()) { >+ videoFullscreenModel->didExitPictureInPicture(); >+ videoFullscreenModel->setVideoLayerGravity(MediaPlayerEnums::VideoGravityResizeAspect); > } >+ } > >- _videoFullscreenInterfaceMac->clearMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture); >+ if (VideoFullscreenChangeObserver* fullscreenChangeObserver = _videoFullscreenInterfaceMac->videoFullscreenChangeObserver()) >+ fullscreenChangeObserver->didExitFullscreen(); > >- if (VideoFullscreenChangeObserver* fullscreenChangeObserver = _videoFullscreenInterfaceMac->videoFullscreenChangeObserver()) >- fullscreenChangeObserver->didExitFullscreen(); >- } >+ _videoFullscreenInterfaceMac->clearMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture); > } > > - (void)pipActionPlay:(PIPViewController *)pip
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194099
: 360742 |
360756