Title: [271387] trunk/Source
- Revision
- 271387
- Author
- [email protected]
- Date
- 2021-01-11 17:11:37 -0800 (Mon, 11 Jan 2021)
Log Message
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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (271386 => 271387)
--- trunk/Source/WebCore/ChangeLog 2021-01-12 00:54:36 UTC (rev 271386)
+++ trunk/Source/WebCore/ChangeLog 2021-01-12 01:11:37 UTC (rev 271387)
@@ -1,3 +1,18 @@
+2021-01-11 Peng Liu <[email protected]>
+
+ 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-11 Fujii Hironori <[email protected]>
[WinCairo] Unreviewed build fix for r271353
Modified: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h (271386 => 271387)
--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h 2021-01-12 00:54:36 UTC (rev 271386)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.h 2021-01-12 01:11:37 UTC (rev 271387)
@@ -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: trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm (271386 => 271387)
--- trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm 2021-01-12 00:54:36 UTC (rev 271386)
+++ trunk/Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm 2021-01-12 01:11:37 UTC (rev 271387)
@@ -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: trunk/Source/WebKit/ChangeLog (271386 => 271387)
--- trunk/Source/WebKit/ChangeLog 2021-01-12 00:54:36 UTC (rev 271386)
+++ trunk/Source/WebKit/ChangeLog 2021-01-12 01:11:37 UTC (rev 271387)
@@ -1,3 +1,14 @@
+2021-01-11 Peng Liu <[email protected]>
+
+ 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-11 Megan Gardner <[email protected]>
Double tap to select does not work if the page clears selections on tap, like grammarly.com does
Modified: trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm (271386 => 271387)
--- trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm 2021-01-12 00:54:36 UTC (rev 271386)
+++ trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm 2021-01-12 01:11:37 UTC (rev 271387)
@@ -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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes