Bug 79791

Summary: Setting mode for track element not working
Product: WebKit Reporter: Sam Dutton <dutton>
Component: MediaAssignee: Anna Cavender <annacc>
Status: RESOLVED FIXED    
Severity: Normal CC: annacc, arun.patole, ericbidelman, eric.carlson, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Screenshot showing default rendering of track subtitles, though mode set to TextTrack.HIDDEN
none
fixes problem, needs tests
none
including tests
none
Patch for landing
none
Patch for landing none

Description Sam Dutton 2012-02-28 07:28:25 PST
Created attachment 129249 [details]
Screenshot showing default rendering of track subtitles, though mode set to TextTrack.HIDDEN

Simple example:

http://html5-demos.appspot.com/static/video/track

Expected behaviour: default subtitles should not be rendered:

var track = video.textTracks[0];
track.mode = TextTrack.HIDDEN;

What actually happens: subtitles rendered over video.

Likewise, in track.js on 

http://www.samdutton.com/track

I attempt to set the mode of the metadata track to 1 (TextTrack.HIDDEN). This is the track used for the text in the right hand box.

Also doesn't work from Chrome Dev Tools. Try the following from the Dev Tools console: 

    document.querySelector("video").textTracks[1].mode = TextTrack.HIDDEN

According to the spec, it should be possible to change the text track mode: http://dev.w3.org/html5/spec/video.html#texttrack.

(BTW: I'm pretty sure setting mode worked OK in Chrome ??18.)

See also http://code.google.com/p/chromium/issues/detail?id=113413
Comment 1 Anna Cavender 2012-04-02 16:49:23 PDT
I believe the problem is that when the mode is set, m_showingByDefault remains true, when really it should be set to false.  Patch coming shortly.
Comment 2 Anna Cavender 2012-04-02 17:03:05 PDT
Created attachment 135231 [details]
fixes problem, needs tests
Comment 3 Eric Carlson 2012-04-03 09:48:58 PDT
This change looks OK, but we should have the test in the same patch.
Comment 4 Anna Cavender 2012-04-03 13:11:21 PDT
Created attachment 135405 [details]
including tests
Comment 5 Eric Carlson 2012-04-03 14:49:06 PDT
Comment on attachment 135405 [details]
including tests

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

> LayoutTests/media/track/track-mode.html:16
> +

Nit: this blank line is unnecessary.
Comment 6 Anna Cavender 2012-04-03 15:03:51 PDT
Created attachment 135436 [details]
Patch for landing
Comment 7 WebKit Review Bot 2012-04-03 15:53:52 PDT
Comment on attachment 135436 [details]
Patch for landing

Rejecting attachment 135436 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 1

ERROR: /mnt/git/webkit-commit-queue/LayoutTests/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://queues.webkit.org/results/12317525
Comment 8 Anna Cavender 2012-04-03 16:27:31 PDT
Created attachment 135450 [details]
Patch for landing
Comment 9 WebKit Review Bot 2012-04-03 17:04:40 PDT
Comment on attachment 135450 [details]
Patch for landing

Clearing flags on attachment: 135450

Committed r113110: <http://trac.webkit.org/changeset/113110>
Comment 10 WebKit Review Bot 2012-04-03 17:04:45 PDT
All reviewed patches have been landed.  Closing bug.