Changeset 117326 in webkit


Ignore:
Timestamp:
May 16, 2012 12:55:05 PM (12 years ago)
Author:
jer.noble@apple.com
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:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117325 r117326  
     12012-05-16  Jer Noble  <jer.noble@apple.com>
     2
     3        <video> elements with no video tracks report false for webkitSupportsFullscreen.
     4        https://bugs.webkit.org/show_bug.cgi?id=86650
     5
     6        Reviewed by Eric Carlson.
     7
     8        Fix media-fullscreen.js to support the new FULLSCREEN_API events, if present.
     9        Fix the media-fullscreen-inline.html test and unskip on Lion.
     10
     11        * media/media-fullscreen-inline-expected.txt:
     12        * media/media-fullscreen-inline.html:
     13        * media/media-fullscreen.js:
     14        (fullscreenchange):
     15        (loadedmetadata):
     16        (addEventListeners):
     17        * platform/mac-lion/Skipped:
     18
    1192012-05-16  Marcelo Lira <marcelo.lira@openbossa.org>
    220
  • trunk/LayoutTests/media/media-fullscreen-inline-expected.txt

    r54143 r117326  
    1515* event handler triggered by user gesture
    1616
    17 *** Creating <video> element with "content/silence.mpg" in the document, should NOT support fullscreen because it is an audio-only <video> element
    18 EVENT(loadstart)
    19 EVENT(durationchange)
    20 EVENT(canplaythrough)
    21 * event handler NOT triggered by a user gesture
    22 EXPECTED (mediaElement.webkitSupportsFullscreen == 'false') OK
    23 EXPECTED (mediaElement.webkitDisplayingFullscreen == 'false') OK
    24 TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
    25 * clicking on button
    26 EVENT(mouseup)
    27 * event handler triggered by user gesture
    28 TEST(mediaElement.webkitEnterFullScreen()) THROWS(DOMException.INVALID_STATE_ERR) OK
    29 
    3017*** Creating <video> element with "content/test.mp4" in the document, should support fullscreen because it is a <video> element with video media
    3118EVENT(loadstart)
     
    4027* event handler triggered by user gesture
    4128RUN(mediaElement.webkitEnterFullScreen())
    42 EVENT(webkitbeginfullscreen)
     29EVENT(webkitfullscreenchange)
    4330EXPECTED (mediaElement.webkitDisplayingFullscreen == 'true') OK
    4431RUN(mediaElement.webkitExitFullScreen())
    45 EVENT(webkitendfullscreen)
     32EVENT(webkitfullscreenchange)
    4633
    4734END OF TEST
  • trunk/LayoutTests/media/media-fullscreen-inline.html

    r79630 r117326  
    1919                        inline : true,
    2020                        type : 'audio',
    21                     },
    22                     {
    23                         url : "content/silence.mpg",
    24                         description : "because it is an audio-only &lt;video&gt element",
    25                         supportsFS : false,
    26                         inline : true,
    27                         type : 'video',
    2821                    },
    2922                    {
  • trunk/LayoutTests/media/media-fullscreen.js

    r54143 r117326  
    2626    eventSender.mouseDown();
    2727    eventSender.mouseUp();
     28}
     29
     30function fullscreenchange()
     31{
     32    if (document.webkitIsFullScreen)
     33        beginfullscreen();
     34    else
     35        endfullscreen();
    2836}
    2937
     
    115123    waitForEvent('webkitbeginfullscreen', beginfullscreen);
    116124    waitForEvent('webkitendfullscreen', endfullscreen);
     125    waitForEvent('webkitfullscreenchange', fullscreenchange);
    117126}
    118127
  • trunk/LayoutTests/platform/mac-lion/Skipped

    r117163 r117326  
    7373media/controls-without-preload.html
    7474media/media-document-audio-repaint.html
    75 media/media-fullscreen-inline.html
    7675media/media-fullscreen-not-in-document.html
    7776media/video-canvas-alpha.html
  • trunk/Source/WebCore/ChangeLog

    r117323 r117326  
     12012-05-16  Jer Noble  <jer.noble@apple.com>
     2
     3        <video> elements with no video tracks report false for webkitSupportsFullscreen.
     4        https://bugs.webkit.org/show_bug.cgi?id=86650
     5
     6        Reviewed by Eric Carlson.
     7
     8        No new tests; updated media/media-fullscreen-inline.html.
     9
     10        With the new Full Screen API, the restriction that only video elements with
     11        video tracks can enter full screen seems arbitrary. Some media types will
     12        occasionally determine they have video tracks long after loadedmetadata, which
     13        breaks websites who check for webkitSupportsFullscreen(). Relax the restriction
     14        on webkitSupportsFullscreen() for ports where the Full Screen API is enabled and
     15        supported so as to no longer require hasVideo().
     16
     17        * html/HTMLVideoElement.cpp:
     18        (WebCore::HTMLVideoElement::supportsFullscreen):
     19
    1202012-05-16  Andreas Kling  <kling@webkit.org>
    221
  • trunk/Source/WebCore/html/HTMLVideoElement.cpp

    r117195 r117326  
    141141        return false;
    142142
    143     if (!player() || !player()->supportsFullscreen() || !player()->hasVideo())
     143    if (!player() || !player()->supportsFullscreen())
    144144        return false;
    145145
    146     // Check with the platform client.
    147146#if ENABLE(FULLSCREEN_API)
     147    // If the full screen API is enabled and is supported for the current element
     148    // do not require that the player has a video track to enter full screen.
    148149    if (page->chrome()->client()->supportsFullScreenForElement(this, false))
    149150        return true;
    150151#endif
     152
     153    if (!player()->hasVideo())
     154        return false;
    151155
    152156    return page->chrome()->client()->supportsFullscreenForNode(this);
Note: See TracChangeset for help on using the changeset viewer.