Closed
Bug 855100
Opened 13 years ago
Closed 13 years ago
[webvtt] new track.track should return empty TextTrack?
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: rillian, Unassigned)
References
Details
Attachments
(1 file, 1 obsolete file)
|
3.25 KB,
patch
|
humph
:
review+
|
Details | Diff | Splinter Review |
Debugging a crash with msaad's DOM tests in bug 833386 I discovered we're not setting HTMLTrackElement::mTrack to anything in the constructor. The getter says:
// XXXhumph: where to set this?
return mTrack;
When the HTML parser loads a track, everything is fine, but reyre's integration branch segfaults if I say:
document.createElement('track').track;
because the wrapper can't handle a null object reference.
I'm actually unclear from the spec what we should do here. Can we throw? return an TextTrack with default attribute values? The later is what Chrome does and what the test seems to expect, so maybe we should do that.
Comment 1•13 years ago
|
||
Looking at HTMLTextTrack, I found the following:
"The track IDL attribute must, on getting, return the track element's text track's corresponding TextTrack object." It doesn't specify the default return for the TextTrack.
We could return a TextTrack with no cues on it, with mode set to disabled. By disabled, the specification says:
"Disabled
Indicates that the text track is not active. Other than for the purposes of exposing the track in the DOM, the user agent is ignoring the text track. No cues are active, no events are fired, and the user agent will not attempt to obtain the track's cues.
"
| Reporter | ||
Comment 2•13 years ago
|
||
That seems more likely that returning undefined or throwing. We'd have to create a TextTrack with all the default properties, not just mode:
{
kind: captions,
mode: disabled,
label: '',
language: '',
etc.
}
Comment 3•13 years ago
|
||
Not having a return on mTrack is blocking the execution of HTMLTrackElements tests. We should approach a temporarily fix so that we can move on.
Kind : Subtitles
label : empty string
language : empty string
mode : disabled
activeCues : null
cues : null
| Reporter | ||
Comment 4•13 years ago
|
||
Proposed fix msaad and I developed. Fixes the segfault with document.createElement('track').track;
Already landed in reyre's integration branch.
Please review for inclusion on the patch for bug 833385.
Attachment #730906 -
Flags: review?(david.humphrey)
Comment 5•13 years ago
|
||
Comment on attachment 730906 [details] [diff] [review]
Initialize mTrack with a empty TextTrack object
+ mTrack = new TextTrack(OwnerDoc()->GetParentObject());
Why not do this lazily in the Track() getter, only creating this empty track object if accessed (i.e., guard on !mTrack and create there before returning)? Most of the time we'll be populating mTrack by loading a .vtt file and throwing this away.
The rest looks good to me.
Attachment #730906 -
Flags: review?(david.humphrey) → review-
| Reporter | ||
Comment 6•13 years ago
|
||
Good idea.
Attachment #730906 -
Attachment is obsolete: true
Attachment #730948 -
Flags: review?(david.humphrey)
Updated•13 years ago
|
Attachment #730948 -
Flags: review?(david.humphrey) → review+
| Reporter | ||
Comment 7•13 years ago
|
||
Merged into the patch for bug 833385.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•