Commit 2ef5ac99 authored by jer.noble@apple.com's avatar jer.noble@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.

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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8104716f
2012-05-16 Jer Noble <jer.noble@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.lira@openbossa.org>
[Qt][Mac]REGRESSION?(r89397) It made fast/css/custom-font-xheight.html crash
......
......@@ -14,19 +14,6 @@ EXPECTED (mediaElement.webkitDisplayingFullscreen == 'undefined') OK
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 @@ TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR
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
......@@ -19,13 +19,6 @@
inline : true,
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",
......
......@@ -27,6 +27,14 @@ function clickEnterFullscreenButton()
eventSender.mouseUp();
}
function fullscreenchange()
{
if (document.webkitIsFullScreen)
beginfullscreen();
else
endfullscreen();
}
function beginfullscreen()
{
testExpected("mediaElement.webkitDisplayingFullscreen", true);
......@@ -114,5 +122,6 @@ function addEventListeners(elem)
waitForEvent('webkitbeginfullscreen', beginfullscreen);
waitForEvent('webkitendfullscreen', endfullscreen);
waitForEvent('webkitfullscreenchange', fullscreenchange);
}
......@@ -72,7 +72,6 @@ mathml/presentation/style.xhtml
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
......
2012-05-16 Jer Noble <jer.noble@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 <kling@webkit.org>
Avoid reparsing the style attribute when cloning elements.
......@@ -140,15 +140,19 @@ bool HTMLVideoElement::supportsFullscreen() const
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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment