Title: [271818] branches/safari-611-branch/Source
Revision
271818
Author
alanc...@apple.com
Date
2021-01-25 14:10:41 -0800 (Mon, 25 Jan 2021)

Log Message

Cherry-pick r271387. rdar://problem/73469606

    Receiving two enter/exit fullscreen delegate callbacks on iPad when presenting fullscreen elements
    https://bugs.webkit.org/show_bug.cgi?id=218688

    Reviewed by Darin Adler.

    Source/WebCore:

    On iPads, when a video enters/exits fullscreen standby, we should not call the
    video fullscreen delegate callbacks.

    * platform/ios/VideoFullscreenInterfaceAVKit.h:
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (VideoFullscreenInterfaceAVKit::setupFullscreen):
    (VideoFullscreenInterfaceAVKit::exitFullscreen):

    Source/WebKit:

    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
    (WebKit::VideoFullscreenManagerProxy::didExitFullscreen):
    (WebKit::VideoFullscreenManagerProxy::didEnterFullscreen):

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

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (271817 => 271818)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-01-25 22:10:36 UTC (rev 271817)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-01-25 22:10:41 UTC (rev 271818)
@@ -1,5 +1,48 @@
 2021-01-25  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r271387. rdar://problem/73469606
+
+    Receiving two enter/exit fullscreen delegate callbacks on iPad when presenting fullscreen elements
+    https://bugs.webkit.org/show_bug.cgi?id=218688
+    
+    Reviewed by Darin Adler.
+    
+    Source/WebCore:
+    
+    On iPads, when a video enters/exits fullscreen standby, we should not call the
+    video fullscreen delegate callbacks.
+    
+    * platform/ios/VideoFullscreenInterfaceAVKit.h:
+    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
+    (VideoFullscreenInterfaceAVKit::setupFullscreen):
+    (VideoFullscreenInterfaceAVKit::exitFullscreen):
+    
+    Source/WebKit:
+    
+    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
+    (WebKit::VideoFullscreenManagerProxy::didExitFullscreen):
+    (WebKit::VideoFullscreenManagerProxy::didEnterFullscreen):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-11  Peng Liu  <peng.l...@apple.com>
+
+            Receiving two enter/exit fullscreen delegate callbacks on iPad when presenting fullscreen elements
+            https://bugs.webkit.org/show_bug.cgi?id=218688
+
+            Reviewed by Darin Adler.
+
+            On iPads, when a video enters/exits fullscreen standby, we should not call the
+            video fullscreen delegate callbacks.
+
+            * platform/ios/VideoFullscreenInterfaceAVKit.h:
+            * platform/ios/VideoFullscreenInterfaceAVKit.mm:
+            (VideoFullscreenInterfaceAVKit::setupFullscreen):
+            (VideoFullscreenInterfaceAVKit::exitFullscreen):
+
+2021-01-25  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r271367. rdar://problem/73469641
 
     REGRESSION (r258321): CSS rules using :first-of-type are applied to any/all siblings in a group under certain circumstances

Modified: branches/safari-611-branch/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h (271817 => 271818)


--- branches/safari-611-branch/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h	2021-01-25 22:10:36 UTC (rev 271817)
+++ branches/safari-611-branch/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h	2021-01-25 22:10:41 UTC (rev 271818)
@@ -90,6 +90,7 @@
     WEBCORE_EXPORT void setHasVideoContentLayer(bool);
     WEBCORE_EXPORT void setInlineRect(const IntRect&, bool visible);
     WEBCORE_EXPORT void preparedToReturnToStandby();
+    bool changingStandbyOnly() { return m_changingStandbyOnly; }
 
     enum class ExitFullScreenReason {
         DoneButtonTapped,
@@ -218,6 +219,7 @@
     bool m_inlineIsVisible { false };
     bool m_standby { false };
     bool m_targetStandby { false };
+    bool m_changingStandbyOnly { false };
 
 #if PLATFORM(WATCHOS)
     bool m_waitingForPreparedToExit { false };

Modified: branches/safari-611-branch/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm (271817 => 271818)


--- branches/safari-611-branch/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2021-01-25 22:10:36 UTC (rev 271817)
+++ branches/safari-611-branch/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm	2021-01-25 22:10:41 UTC (rev 271818)
@@ -931,6 +931,8 @@
     ASSERT(standby || mode != HTMLMediaElementEnums::VideoFullscreenModeNone);
     LOG(Fullscreen, "VideoFullscreenInterfaceAVKit::setupFullscreen(%p)", this);
 
+    m_changingStandbyOnly = mode == HTMLMediaElementEnums::VideoFullscreenModeNone && standby;
+
     [playerController() setHasEnabledVideo:true];
     [playerController() setHasVideo:true];
     [playerController() setContentDimensions:videoDimensions];
@@ -962,6 +964,8 @@
     if (m_standby && m_enteringPictureInPicture)
         return false;
 
+    m_changingStandbyOnly = !m_currentMode.hasVideo() && m_standby;
+
     m_targetMode = HTMLMediaElementEnums::VideoFullscreenModeNone;
 
     setInlineRect(finalRect, true);
@@ -1490,6 +1494,7 @@
         }
         m_fullscreenChangeObserver->didEnterFullscreen(size);
         m_enteringPictureInPicture = false;
+        m_changingStandbyOnly = false;
     }
 
     if (m_currentMode.hasPictureInPicture() && m_videoFullscreenModel && !m_restoringFullscreenForPictureInPictureStop)
@@ -1537,6 +1542,7 @@
     dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this] {
         if (m_fullscreenChangeObserver)
             m_fullscreenChangeObserver->didExitFullscreen();
+        m_changingStandbyOnly = false;
     });
 }
 

Modified: branches/safari-611-branch/Source/WebKit/ChangeLog (271817 => 271818)


--- branches/safari-611-branch/Source/WebKit/ChangeLog	2021-01-25 22:10:36 UTC (rev 271817)
+++ branches/safari-611-branch/Source/WebKit/ChangeLog	2021-01-25 22:10:41 UTC (rev 271818)
@@ -1,5 +1,44 @@
 2021-01-25  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r271387. rdar://problem/73469606
+
+    Receiving two enter/exit fullscreen delegate callbacks on iPad when presenting fullscreen elements
+    https://bugs.webkit.org/show_bug.cgi?id=218688
+    
+    Reviewed by Darin Adler.
+    
+    Source/WebCore:
+    
+    On iPads, when a video enters/exits fullscreen standby, we should not call the
+    video fullscreen delegate callbacks.
+    
+    * platform/ios/VideoFullscreenInterfaceAVKit.h:
+    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
+    (VideoFullscreenInterfaceAVKit::setupFullscreen):
+    (VideoFullscreenInterfaceAVKit::exitFullscreen):
+    
+    Source/WebKit:
+    
+    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
+    (WebKit::VideoFullscreenManagerProxy::didExitFullscreen):
+    (WebKit::VideoFullscreenManagerProxy::didEnterFullscreen):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-11  Peng Liu  <peng.l...@apple.com>
+
+            Receiving two enter/exit fullscreen delegate callbacks on iPad when presenting fullscreen elements
+            https://bugs.webkit.org/show_bug.cgi?id=218688
+
+            Reviewed by Darin Adler.
+
+            * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
+            (WebKit::VideoFullscreenManagerProxy::didExitFullscreen):
+            (WebKit::VideoFullscreenManagerProxy::didEnterFullscreen):
+
+2021-01-25  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r271386. rdar://problem/73426229
 
     Double tap to select does not work if the page clears selections on tap, like grammarly.com does

Modified: branches/safari-611-branch/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm (271817 => 271818)


--- branches/safari-611-branch/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm	2021-01-25 22:10:36 UTC (rev 271817)
+++ branches/safari-611-branch/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm	2021-01-25 22:10:41 UTC (rev 271818)
@@ -763,6 +763,11 @@
 void VideoFullscreenManagerProxy::didExitFullscreen(PlaybackSessionContextIdentifier contextId)
 {
     m_page->send(Messages::VideoFullscreenManager::DidExitFullscreen(contextId));
+
+#if PLATFORM(IOS_FAMILY)
+    if (ensureInterface(contextId).changingStandbyOnly())
+        return;
+#endif
     m_page->didExitFullscreen();
 }
 
@@ -773,6 +778,11 @@
         optionalSize = size;
 
     m_page->send(Messages::VideoFullscreenManager::DidEnterFullscreen(contextId, optionalSize));
+
+#if PLATFORM(IOS_FAMILY)
+    if (ensureInterface(contextId).changingStandbyOnly())
+        return;
+#endif
     m_page->didEnterFullscreen();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to