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 26442 - Clarify if TextTrackCueList should be able to be converted to Array
Summary: Clarify if TextTrackCueList should be able to be converted to Array
Status: RESOLVED INVALID
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-28 13:35 UTC by Rick Eyre
Modified: 2014-07-28 15:13 UTC (History)
5 users (show)

See Also:


Attachments

Description Rick Eyre 2014-07-28 13:35:44 UTC
Should the code, `Array.prototype.slice.call(TTObj, 0)`, be able to convert either TextTrackLists or TextTrackCueLists to arrays? Currently this works on Chrome, but not on Firefox. If so, can there be some clarification added to the spec on whether or not this should work.
Comment 1 Boris Zbarsky 2014-07-28 13:47:23 UTC
> Currently this works on Chrome, but not on Firefox. 

It seems to work just fine in Firefox, as expected.  Why do you think it doesn't work?
Comment 2 Rick Eyre 2014-07-28 15:01:32 UTC
(In reply to Boris Zbarsky from comment #1)

> It seems to work just fine in Firefox, as expected.  Why do you think it
> doesn't work?

Yeah, you're right Boris... It seems like I've been testing this wrong. I didn't understand the issue clearly.

Should we still add clarification to the spec around this? I'm not sure what objects count as `able to be converted to an array`, that's kind of vague to me, unless I'm missing something. It's also unclear to me that TextTrack(Cue)Lists should be able to do this.
Comment 3 Boris Zbarsky 2014-07-28 15:08:24 UTC
> I'm not sure what objects count as `able to be converted to an array`

See the spec for Array.prototype.slice at http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.slice

Basically, as long as it has a "length" property and then has numbered properties from 0 to length-1, slice() will produce an array from it.

That's obviously true for these objects, given their .length and indexed getter.
Comment 4 Rick Eyre 2014-07-28 15:13:27 UTC
(In reply to Boris Zbarsky from comment #3)

> See the spec for Array.prototype.slice at
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.
> slice
> 
> Basically, as long as it has a "length" property and then has numbered
> properties from 0 to length-1, slice() will produce an array from it.
> 
> That's obviously true for these objects, given their .length and indexed
> getter.

Okay, that makes sense. That's why it just works. Thanks!

Closing this as invalid.