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 17271 - <track> should not load without a media element parent
Summary: <track> should not load without a media element parent
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
Depends on:
Reported: 2012-05-31 12:52 UTC by contributor
Modified: 2012-09-12 14:44 UTC (History)
4 users (show)

See Also:


Description contributor 2012-05-31 12:52:32 UTC

<track> Move crossorigin="" to <track>

Posted from: 2001:4c28:a030:30:10c4:66a0:3c62:e586 by
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.7.3; U; en) Presto/2.10.229 Version/11.64
Comment 1 Simon Pieters 2012-05-31 12:56:31 UTC
If URL is not the empty string, perform a potentially CORS-enabled fetch of URL, with the mode being the state of the media element's crossorigin content attribute, the origin being the origin of the media element's Document, and the default origin behaviour set to fail.

I think this is problematic for several reasons:

* There might not be a media element.
* You might want to allow cross-origin fetching of the video but not of the tracks, or vice versa.

I think it would be better to have a crossorigin attribute on <track> and let the track load algorithm look only at that.
Comment 2 Simon Pieters 2012-06-01 16:12:22 UTC
We discussed this for a bit internally and concluded that the added flexibility with <track crossorigin> was not worth the added verbosity. To solve this:

> * There might not be a media element.

We suggest instead that <track> never loads if it doesn't have a media element as parent.
Comment 3 contributor 2012-07-18 17:42:55 UTC
This bug was cloned to create bug 18216 as part of operation convergence.
Comment 4 Ian 'Hixie' Hickson 2012-09-10 22:32:49 UTC
So the idea is just to disable <track> _until_ it has a media element parent, but once it has one, to switch on the <track> element and leave it "on" even if the element is moved out again?
Comment 5 Simon Pieters 2012-09-11 07:35:55 UTC
Yeah, there isn't much reason to kill a <track> if it gets moved out of its media parent. Just when the load starts, if it doesn't have a media element parent, stop the load algorithm. When a track element gets a new media element parent, it probably makes sense to rerun the load algorithm (like when src changes).
Comment 6 Ian 'Hixie' Hickson 2012-09-11 21:51:42 UTC
I made this change as part of wider track changes. Let me know if the spec looks good now or not.
Comment 7 Simon Pieters 2012-09-12 14:44:43 UTC
It looks good.

First I thought it would be better to read the crossorigin attribute before awaiting a stable state so that we don't need to check the parent again, but I realize that we probably want scripts to be able to set things in arbitrary order and have the same outcome, which means we have to await a stable state (<img> also does that).