Bug 86650 - <video> elements with no video tracks report false for webkitSupportsFullscreen.
Summary: <video> elements with no video tracks report false for webkitSupportsFullscreen.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-05-16 10:17 PDT by Jer Noble
Modified: 2012-05-16 12:54 PDT (History)
3 users (show)

See Also:


Attachments
Patch (10.27 KB, patch)
2012-05-16 12:15 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (7.44 KB, patch)
2012-05-16 12:27 PDT, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2012-05-16 10:17:22 PDT
HLS streams in <video> elements report false for webkitSupportsFullscreen.
Comment 1 Jer Noble 2012-05-16 10:20:48 PDT
HLS streams will report a duration before they determine whether they have a video track.  So scripts listening for durationchange events on a <video> element will ask whether the element supports full screen, and will be told "no", because they do not yet have a video track.

This made sense when using the old, webkit-specific full screen mode.  However, now that any element can be taken into full screen using the new FULLSCREEN_API, this restriction is rather arbitrary.

If the FULLSCREEN_API is enabled and supported, bypass the hasVideo() check in supportsFullscreen().
Comment 2 Jer Noble 2012-05-16 12:15:35 PDT
Created attachment 142319 [details]
Patch
Comment 3 Jer Noble 2012-05-16 12:27:08 PDT
Created attachment 142323 [details]
Patch

Removed extraneous added file; updated Skipped list to unskip newly passing test.
Comment 4 Jer Noble 2012-05-16 12:28:02 PDT
<rdar://problem/11430261>
Comment 5 Eric Carlson 2012-05-16 12:42:06 PDT
Comment on attachment 142323 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=142323&action=review

> Source/WebCore/ChangeLog:3
> +        HLS streams in <video> elements report false for webkitSupportsFullscreen.

This should be updated.

> Source/WebCore/ChangeLog:15
> +        With the new Full Screen API, the restriction that only video elements with
> +        video tracks can enter full screen seems arbitrary.  HLS streams 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().

The HLS detail probably isn't worth mentioning in the change log, the same timing detail could happen for other formats or media engines.

> LayoutTests/media/media-fullscreen-inline.html:28
> -                    },
> +                    }

Making sure this test will work in old versions of IE? ;-)
Comment 6 Jer Noble 2012-05-16 12:45:48 PDT
Comment on attachment 142323 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=142323&action=review

>> Source/WebCore/ChangeLog:3
>> +        HLS streams in <video> elements report false for webkitSupportsFullscreen.
> 
> This should be updated.

Already done.

>> Source/WebCore/ChangeLog:15
>> +        supported so as to no longer require hasVideo().
> 
> The HLS detail probably isn't worth mentioning in the change log, the same timing detail could happen for other formats or media engines.

Sure thing. I'll genericize this detail.

Thanks!
Comment 7 Jer Noble 2012-05-16 12:54:19 PDT
Committed r117326: <http://trac.webkit.org/changeset/117326>