Title: [202871] trunk/Source/WebCore
- Revision
- 202871
- Author
- [email protected]
- Date
- 2016-07-06 13:02:11 -0700 (Wed, 06 Jul 2016)
Log Message
Signal that media element is prepared for inline when being stopped since script won't be able to.
https://bugs.webkit.org/show_bug.cgi?id=159163
rdar://problem/26844557
Patch by Jeremy Jones <[email protected]> on 2016-07-06
Reviewed by Jer Noble.
No new tests since this don't change behavior in the DOM. It prevents a race that could cause
fullscreen and picture in picture to fail to tear down completely.
When an element exits a fullscreen mode and is immediately removed from the DOM by the page,
its _javascript_ stops running. The fullscreen code is then blocked waiting for JS to signal
that it has updated its state in preparation for inline mode. This change explicitly signals
this since JS wont be able to.
Additionally, when going from PiP back to inline, don't go through fullscreen first, when the
request comes from the DOM. This was causing the presentation mode to become confused. The
page requests inline. PiP would exit back to fullscreen and set the presentation mode to
fullscreen. Then it would exit fullscreen back to inline, but the DOM still had the wrong
presentation mode. Skipping this removes an unnecessary step in the animation and keeps the
presentation mode state consistent.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Set prepared for inline.
(WebVideoFullscreenInterfaceAVKit::exitFullscreen): Return directly to inlne.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (202870 => 202871)
--- trunk/Source/WebCore/ChangeLog 2016-07-06 19:54:07 UTC (rev 202870)
+++ trunk/Source/WebCore/ChangeLog 2016-07-06 20:02:11 UTC (rev 202871)
@@ -1,3 +1,31 @@
+2016-07-06 Jeremy Jones <[email protected]>
+
+ Signal that media element is prepared for inline when being stopped since script won't be able to.
+ https://bugs.webkit.org/show_bug.cgi?id=159163
+ rdar://problem/26844557
+
+ Reviewed by Jer Noble.
+
+ No new tests since this don't change behavior in the DOM. It prevents a race that could cause
+ fullscreen and picture in picture to fail to tear down completely.
+
+ When an element exits a fullscreen mode and is immediately removed from the DOM by the page,
+ its _javascript_ stops running. The fullscreen code is then blocked waiting for JS to signal
+ that it has updated its state in preparation for inline mode. This change explicitly signals
+ this since JS wont be able to.
+
+ Additionally, when going from PiP back to inline, don't go through fullscreen first, when the
+ request comes from the DOM. This was causing the presentation mode to become confused. The
+ page requests inline. PiP would exit back to fullscreen and set the presentation mode to
+ fullscreen. Then it would exit fullscreen back to inline, but the DOM still had the wrong
+ presentation mode. Skipping this removes an unnecessary step in the animation and keeps the
+ presentation mode state consistent.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
+ * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Set prepared for inline.
+ (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Return directly to inlne.
+
2016-07-06 Chris Dumez <[email protected]>
Add support for Node.isConnected
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (202870 => 202871)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-07-06 19:54:07 UTC (rev 202870)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-07-06 20:02:11 UTC (rev 202871)
@@ -5067,6 +5067,8 @@
if (m_videoFullscreenMode != VideoFullscreenModeNone)
exitFullscreen();
+ setPreparedForInline(true);
+
updatePlaybackControlsManager();
m_inActiveDocument = false;
Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (202870 => 202871)
--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm 2016-07-06 19:54:07 UTC (rev 202870)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm 2016-07-06 20:02:11 UTC (rev 202871)
@@ -770,6 +770,7 @@
[[m_playerViewController view] layoutIfNeeded];
if (isMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)) {
+ m_shouldReturnToFullscreenWhenStoppingPiP = false;
[m_window setHidden:NO];
[m_playerViewController stopPictureInPicture];
} else if (isMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture | HTMLMediaElementEnums::VideoFullscreenModeStandard)) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes