This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16076 - <track> This constructor is horrible. Too many arguments. Also, settings as a string? Ugh. Can we make it have one argument that takes an object with id, startTime, endTime, text, pauseOnExit and all the settings as properties instead? e.g. new TextTrackC
Summary: <track> This constructor is horrible. Too many arguments. Also, settings as a...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-22 15:17 UTC by contributor
Modified: 2012-09-11 23:40 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2012-02-22 15:17:05 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html
Multipage: http://www.whatwg.org/C#texttrackcue
Complete: http://www.whatwg.org/c#texttrackcue

Comment:
<track> This constructor is horrible. Too many arguments. Also, settings as a
string? Ugh. Can we make it have one argument that takes an object with id,
startTime, endTime, text, pauseOnExit and all the settings as properties
instead? e.g. new TextTrackCue({startTime:0, endTime:1, vertical:"lr",
text:"LOL"})

Posted from: 94.234.170.44 by simonp@opera.com
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.7.2; U; en) Presto/2.10.229 Version/11.61
Comment 1 Simon Pieters 2012-02-22 15:23:53 UTC
Or even better, remove all arguments. The properties are mutable anyway.
Comment 2 Simon Pieters 2012-05-08 10:44:11 UTC
After discussing this internally, we prefer if the constructor looked like this:

[Constructor(double startTime, double endTime, DOMString text)]
Comment 3 contributor 2012-06-05 22:01:45 UTC
Checked in as WHATWG revision r7120.
Check-in comment: Simplify the TextTrackCue constructor now that the object's properties are all mutable.
http://html5.org/tools/web-apps-tracker?from=7119&to=7120
Comment 4 Philip J├Ągenstedt 2012-06-07 12:21:26 UTC
Reopening since you forgot to change one of the examples:

// add sounds we care about
sounds.addCue(new TextTrackCue('dog bark', 12.783, 13.612, '', '', '', true));
sounds.addCue(new TextTrackCue('kitten mew', 13.612, 15.091, '', '', '', true));
Comment 5 contributor 2012-07-18 17:44:16 UTC
This bug was cloned to create bug 18222 as part of operation convergence.
Comment 6 contributor 2012-09-11 23:40:32 UTC
Checked in as WHATWG revision r7331.
Check-in comment: Fix an example to use the new API.
http://html5.org/tools/web-apps-tracker?from=7330&to=7331