Title: [117326] trunk
Revision
117326
Author
jer.no...@apple.com
Date
2012-05-16 12:55:05 -0700 (Wed, 16 May 2012)

Log Message

<video> elements with no video tracks report false for webkitSupportsFullscreen.
https://bugs.webkit.org/show_bug.cgi?id=86650

Reviewed by Eric Carlson.

Source/WebCore:

No new tests; updated media/media-fullscreen-inline.html.

With the new Full Screen API, the restriction that only video elements with
video tracks can enter full screen seems arbitrary. Some media types will
occasionally determine they have video tracks long after loadedmetadata, which
breaks websites who check for webkitSupportsFullscreen(). Relax the restriction
on webkitSupportsFullscreen() for ports where the Full Screen API is enabled and
supported so as to no longer require hasVideo().

* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::supportsFullscreen):

LayoutTests:

Fix media-fullscreen.js to support the new FULLSCREEN_API events, if present.
Fix the media-fullscreen-inline.html test and unskip on Lion.

* media/media-fullscreen-inline-expected.txt:
* media/media-fullscreen-inline.html:
* media/media-fullscreen.js:
(fullscreenchange):
(loadedmetadata):
(addEventListeners):
* platform/mac-lion/Skipped:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (117325 => 117326)


--- trunk/LayoutTests/ChangeLog	2012-05-16 19:48:12 UTC (rev 117325)
+++ trunk/LayoutTests/ChangeLog	2012-05-16 19:55:05 UTC (rev 117326)
@@ -1,3 +1,21 @@
+2012-05-16  Jer Noble  <jer.no...@apple.com>
+
+        <video> elements with no video tracks report false for webkitSupportsFullscreen.
+        https://bugs.webkit.org/show_bug.cgi?id=86650
+
+        Reviewed by Eric Carlson.
+
+        Fix media-fullscreen.js to support the new FULLSCREEN_API events, if present.
+        Fix the media-fullscreen-inline.html test and unskip on Lion.
+
+        * media/media-fullscreen-inline-expected.txt:
+        * media/media-fullscreen-inline.html:
+        * media/media-fullscreen.js:
+        (fullscreenchange):
+        (loadedmetadata):
+        (addEventListeners):
+        * platform/mac-lion/Skipped:
+
 2012-05-16  Marcelo Lira <marcelo.l...@openbossa.org>
 
         [Qt][Mac]REGRESSION?(r89397) It made fast/css/custom-font-xheight.html crash

Modified: trunk/LayoutTests/media/media-fullscreen-inline-expected.txt (117325 => 117326)


--- trunk/LayoutTests/media/media-fullscreen-inline-expected.txt	2012-05-16 19:48:12 UTC (rev 117325)
+++ trunk/LayoutTests/media/media-fullscreen-inline-expected.txt	2012-05-16 19:55:05 UTC (rev 117326)
@@ -14,19 +14,6 @@
 EVENT(mouseup)
 * event handler triggered by user gesture
 
-*** Creating <video> element with "content/silence.mpg" in the document, should NOT support fullscreen because it is an audio-only <video> element
-EVENT(loadstart)
-EVENT(durationchange)
-EVENT(canplaythrough)
-* event handler NOT triggered by a user gesture
-EXPECTED (mediaElement.webkitSupportsFullscreen == 'false') OK
-EXPECTED (mediaElement.webkitDisplayingFullscreen == 'false') OK
-TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
-* clicking on button
-EVENT(mouseup)
-* event handler triggered by user gesture
-TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
-
 *** Creating <video> element with "content/test.mp4" in the document, should support fullscreen because it is a <video> element with video media
 EVENT(loadstart)
 EVENT(durationchange)
@@ -39,10 +26,10 @@
 EVENT(mouseup)
 * event handler triggered by user gesture
 RUN(mediaElement.webkitEnterFullScreen())
-EVENT(webkitbeginfullscreen)
+EVENT(webkitfullscreenchange)
 EXPECTED (mediaElement.webkitDisplayingFullscreen == 'true') OK
 RUN(mediaElement.webkitExitFullScreen())
-EVENT(webkitendfullscreen)
+EVENT(webkitfullscreenchange)
 
 END OF TEST
 

Modified: trunk/LayoutTests/media/media-fullscreen-inline.html (117325 => 117326)


--- trunk/LayoutTests/media/media-fullscreen-inline.html	2012-05-16 19:48:12 UTC (rev 117325)
+++ trunk/LayoutTests/media/media-fullscreen-inline.html	2012-05-16 19:55:05 UTC (rev 117326)
@@ -20,13 +20,6 @@
                         type : 'audio',
                     },
                     {
-                        url : "content/silence.mpg", 
-                        description : "because it is an audio-only &lt;video&gt element", 
-                        supportsFS : false,
-                        inline : true,
-                        type : 'video',
-                    },
-                    {
                         url : "content/test.mp4", 
                         description : "because it is a &lt;video&gt element with video media", 
                         supportsFS : true,

Modified: trunk/LayoutTests/media/media-fullscreen.js (117325 => 117326)


--- trunk/LayoutTests/media/media-fullscreen.js	2012-05-16 19:48:12 UTC (rev 117325)
+++ trunk/LayoutTests/media/media-fullscreen.js	2012-05-16 19:55:05 UTC (rev 117326)
@@ -27,6 +27,14 @@
     eventSender.mouseUp();
 }
 
+function fullscreenchange()
+{
+    if (document.webkitIsFullScreen)
+        beginfullscreen();
+    else
+        endfullscreen();
+}
+
 function beginfullscreen()
 {
     testExpected("mediaElement.webkitDisplayingFullscreen", true);
@@ -114,5 +122,6 @@
 
     waitForEvent('webkitbeginfullscreen', beginfullscreen);
     waitForEvent('webkitendfullscreen', endfullscreen);
+    waitForEvent('webkitfullscreenchange', fullscreenchange);
 }
 

Modified: trunk/LayoutTests/platform/mac-lion/Skipped (117325 => 117326)


--- trunk/LayoutTests/platform/mac-lion/Skipped	2012-05-16 19:48:12 UTC (rev 117325)
+++ trunk/LayoutTests/platform/mac-lion/Skipped	2012-05-16 19:55:05 UTC (rev 117326)
@@ -72,7 +72,6 @@
 media/controls-styling.html
 media/controls-without-preload.html
 media/media-document-audio-repaint.html
-media/media-fullscreen-inline.html
 media/media-fullscreen-not-in-document.html
 media/video-canvas-alpha.html
 media/video-display-aspect-ratio.html

Modified: trunk/Source/WebCore/ChangeLog (117325 => 117326)


--- trunk/Source/WebCore/ChangeLog	2012-05-16 19:48:12 UTC (rev 117325)
+++ trunk/Source/WebCore/ChangeLog	2012-05-16 19:55:05 UTC (rev 117326)
@@ -1,3 +1,22 @@
+2012-05-16  Jer Noble  <jer.no...@apple.com>
+
+        <video> elements with no video tracks report false for webkitSupportsFullscreen.
+        https://bugs.webkit.org/show_bug.cgi?id=86650
+
+        Reviewed by Eric Carlson.
+
+        No new tests; updated media/media-fullscreen-inline.html.
+
+        With the new Full Screen API, the restriction that only video elements with
+        video tracks can enter full screen seems arbitrary. Some media types will
+        occasionally determine they have video tracks long after loadedmetadata, which
+        breaks websites who check for webkitSupportsFullscreen(). Relax the restriction
+        on webkitSupportsFullscreen() for ports where the Full Screen API is enabled and
+        supported so as to no longer require hasVideo().
+
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::supportsFullscreen):
+
 2012-05-16  Andreas Kling  <kl...@webkit.org>
 
         Avoid reparsing the style attribute when cloning elements.

Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (117325 => 117326)


--- trunk/Source/WebCore/html/HTMLVideoElement.cpp	2012-05-16 19:48:12 UTC (rev 117325)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp	2012-05-16 19:55:05 UTC (rev 117326)
@@ -140,15 +140,19 @@
     if (!page) 
         return false;
 
-    if (!player() || !player()->supportsFullscreen() || !player()->hasVideo())
+    if (!player() || !player()->supportsFullscreen())
         return false;
 
-    // Check with the platform client.
 #if ENABLE(FULLSCREEN_API)
+    // If the full screen API is enabled and is supported for the current element
+    // do not require that the player has a video track to enter full screen.
     if (page->chrome()->client()->supportsFullScreenForElement(this, false))
         return true;
 #endif
 
+    if (!player()->hasVideo())
+        return false;
+
     return page->chrome()->client()->supportsFullscreenForNode(this);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to