Switch tabs before retuning PiP video to inline.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 18:11:31 +0000 (18:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 18:11:31 +0000 (18:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192767
rdar://problem/46006046

Patch by Jeremy Jones <jeremyj@apple.com> on 2018-12-20
Reviewed by Jer Noble.

No new tests because this code path only happens with a user action on system UI.

When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.

* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239447 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm

index 2ab911f..81aa541 100644 (file)
@@ -1,3 +1,18 @@
+2018-12-20  Jeremy Jones  <jeremyj@apple.com>
+
+        Switch tabs before retuning PiP video to inline.
+        https://bugs.webkit.org/show_bug.cgi?id=192767
+        rdar://problem/46006046
+
+        Reviewed by Jer Noble.
+
+        No new tests because this code path only happens with a user action on system UI.
+
+        When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
+
+        * platform/mac/VideoFullscreenInterfaceMac.mm:
+        (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
+
 2018-12-19  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         Unreviewed, fix GTK build after r239410
index 82e2e36..1aa127e 100644 (file)
@@ -272,8 +272,11 @@ enum class PIPState {
 {
     ASSERT_UNUSED(pip, pip == _pipViewController);
 
-    if (!_videoFullscreenInterfaceMac || !_videoFullscreenInterfaceMac->videoFullscreenChangeObserver())
+    if (!_videoFullscreenInterfaceMac)
         return YES;
+    
+    if (_videoFullscreenInterfaceMac->videoFullscreenChangeObserver())
+        _videoFullscreenInterfaceMac->videoFullscreenChangeObserver()->fullscreenMayReturnToInline();
 
     _videoFullscreenInterfaceMac->requestHideAndExitPiP();