Bug 18222 - <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
<track> This constructor is horrible. Too many arguments. Also, settings as a...
Status: RESOLVED FIXED
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec
unspecified
Other other
: P3 normal
: ---
Assigned To: Robin Berjon
HTML WG Bugzilla archive list
http://www.whatwg.org/specs/web-apps/...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-18 17:44 UTC by contributor
Modified: 2012-09-28 05:49 UTC (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description contributor 2012-07-18 17:44:13 UTC
This was was cloned from bug 16076 as part of operation convergence.
Originally filed: 2012-02-22 15:17:00 +0000

================================================================================
 #0   contributor@whatwg.org                          2012-02-22 15:17:05 +0000 
--------------------------------------------------------------------------------
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
================================================================================
 #1   Simon Pieters                                   2012-02-22 15:23:53 +0000 
--------------------------------------------------------------------------------
Or even better, remove all arguments. The properties are mutable anyway.
================================================================================
 #2   Simon Pieters                                   2012-05-08 10:44:11 +0000 
--------------------------------------------------------------------------------
After discussing this internally, we prefer if the constructor looked like this:

[Constructor(double startTime, double endTime, DOMString text)]
================================================================================
 #3   contributor@whatwg.org                          2012-06-05 22:01:45 +0000 
--------------------------------------------------------------------------------
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
================================================================================
 #4   Philip J                                        2012-06-07 12:21:26 +0000 
--------------------------------------------------------------------------------
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 1 Robin Berjon 2012-09-11 15:05:10 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:

   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: Had example mirror new interface.
Rationale: The example was indeed wrong. Interestingly enough, it seems that the example was also wrong against the old constructor (mixing up id and text), which demonstrates pretty well why the new one is better.
Comment 2 Robin Berjon 2012-09-11 15:05:51 UTC
Forgot the commit: https://github.com/w3c/html/commit/afa7953e6d2a78a035e49b3a8459d6338ab342b0
Comment 3 Simon Pieters 2012-09-12 08:02:10 UTC
'dog bark' is supposed to be the id in the example.

http://html5.org/r/7331
Comment 4 Silvia Pfeiffer 2012-09-28 05:49:17 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If
you are satisfied with this response, please change the state of
this bug to CLOSED. If you have additional information and would
like the Editor to reconsider, please reopen this bug. If you would
like to escalate the issue to the full HTML Working Group, please
add the TrackerRequest keyword to this bug, and suggest title and
text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this
document:   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: applied patch
https://github.com/w3c/html/commit/5305a028c4ac34b9883234076df9de5779335cdb
Rationale: adopted resolution by WHATWG