WebKit's Enter Full Screen for <video> elements isn't working
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2013 02:32:03 +0000 (02:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 May 2013 02:32:03 +0000 (02:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=117001

Patch by Ruth Fong <ruth_fong@apple.com> on 2013-05-30
Reviewed by Jer Noble.

Fix workflow to allow a video to enter into full screen
mode from a kWKContextMenuItemTagEnterVideoFullscreen
context menu item by denoting the enterFullscreenForVideo
call as a user gesture, so Document::requestFullScreenForElement
will execute correctly.

No new tests. Covered by media/context-menu-actions.html,
which is disabled due to bug #116651.

* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::enterFullscreenForVideo):

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/HitTestResult.cpp

index 377a874..ca5c45a 100644 (file)
@@ -1,3 +1,22 @@
+2013-05-30  Ruth Fong  <ruth_fong@apple.com>
+
+        WebKit's Enter Full Screen for <video> elements isn't working
+        https://bugs.webkit.org/show_bug.cgi?id=117001
+
+        Reviewed by Jer Noble.
+
+        Fix workflow to allow a video to enter into full screen
+        mode from a kWKContextMenuItemTagEnterVideoFullscreen 
+        context menu item by denoting the enterFullscreenForVideo
+        call as a user gesture, so Document::requestFullScreenForElement
+        will execute correctly.
+
+        No new tests. Covered by media/context-menu-actions.html,
+        which is disabled due to bug #116651.
+
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::enterFullscreenForVideo):
+
 2013-05-30  Rafael Brandao  <rafael.lobo@openbossa.org>
 
         Fix double hash lookup in RenderTableSection::paintObject loop
index 74109e1..d214ce7 100644 (file)
@@ -41,6 +41,7 @@
 #include "RenderImage.h"
 #include "RenderInline.h"
 #include "Scrollbar.h"
+#include "UserGestureIndicator.h"
 
 #if ENABLE(SVG)
 #include "SVGNames.h"
@@ -404,8 +405,10 @@ void HitTestResult::enterFullscreenForVideo() const
     HTMLMediaElement* mediaElt(mediaElement());
     if (mediaElt && mediaElt->hasTagName(HTMLNames::videoTag)) {
         HTMLVideoElement* videoElt = static_cast<HTMLVideoElement*>(mediaElt);
-        if (!videoElt->isFullscreen() && mediaElt->supportsFullscreen())
+        if (!videoElt->isFullscreen() && mediaElt->supportsFullscreen()) {
+            UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture);
             videoElt->enterFullscreen();
+        }
     }
 #endif
 }