REGRESSION (r232301) - Unable to enter video fullscreen
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2018 18:02:02 +0000 (18:02 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2018 18:02:02 +0000 (18:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186357
<rdar://problem/40838449>

Reviewed by Jon Lee.

Only set up the standby fullscreen element if we are in element fullscreen.

* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::videoControlsManagerDidChange):

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

Source/WebKit/ChangeLog
Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp

index de52060..9b2ece8 100644 (file)
@@ -1,3 +1,16 @@
+2018-06-06  Jer Noble  <jer.noble@apple.com>
+
+        REGRESSION (r232301) - Unable to enter video fullscreen
+        https://bugs.webkit.org/show_bug.cgi?id=186357
+        <rdar://problem/40838449>
+
+        Reviewed by Jon Lee.
+
+        Only set up the standby fullscreen element if we are in element fullscreen.
+
+        * WebProcess/FullScreen/WebFullScreenManager.cpp:
+        (WebKit::WebFullScreenManager::videoControlsManagerDidChange):
+
 2018-06-06  Jeremy Jones  <jeremyj@apple.com>
 
         attenuationFactor should be in range [0,1]
index 3bff5a4..11f5790 100644 (file)
@@ -89,7 +89,12 @@ void WebFullScreenManager::videoControlsManagerDidChange()
 {
 #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     auto* currentPlaybackControlsElement = m_page->playbackSessionManager().currentPlaybackControlsElement();
-    setPIPStandbyElement(is<HTMLVideoElement>(currentPlaybackControlsElement) ? downcast<HTMLVideoElement>(currentPlaybackControlsElement) : nullptr);
+    if (!m_element || !is<HTMLVideoElement>(currentPlaybackControlsElement)) {
+        setPIPStandbyElement(nullptr);
+        return;
+    }
+
+    setPIPStandbyElement(downcast<HTMLVideoElement>(currentPlaybackControlsElement));
 #endif
 }