Closed Bug 909993 Opened 12 years ago Closed 10 years ago

[webvtt] Implement TextTrackCue as an abstract class

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: reyre, Assigned: self)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 3 obsolete files)

We have VTTCue implemented now which is a merged form of TextTrackCue and VTTCue in the track and WebVTT specs. To implement this correctly we need to implement TextTrackCue as an abstract class.
Blocks: webvtt
I'm getting more and more skeptical on whether or not we actually need to do this in the future. There aren't any new Cue types being added to the HTML 5. DataCue, the only other Cue type that has been added, is currently at risk [1]. If HTML 5 moves to recommendation without DataCue then I think we should close this bug. http://www.w3.org/html/wg/wiki/HTML5.0AtRiskFeatures
Shouldn't we at least make TextTrackCue an interface so `cue instanceof TextTrackCue` will work?
The patch to implement this is pretty simple. The main differences this cause in JavaScript are: - "TextTrackCue" exists. - `new VTTCue(...) instanceof TextTrackCue` is `true`. - Cues have the correct prototype chain I'm working on a polyfill to create another cue type, and it doesn't work right when TextTrackCue doesn't exist.
Attachment #8633728 - Flags: review?(rick.eyre)
Attachment #8633728 - Flags: checkin?(rick.eyre)
Forgot to fix the tests. It's odd that there was previously a test guaranteeing that TextTrackCue is undefined :\
Attachment #8633728 - Attachment is obsolete: true
Attachment #8633728 - Flags: review?(rick.eyre)
Attachment #8633728 - Flags: checkin?(rick.eyre)
Attachment #8633739 - Flags: review?(rick.eyre)
Attachment #8633739 - Flags: checkin?(rick.eyre)
Comment on attachment 8633739 [details] [diff] [review] 0001-Add-WebIDL-for-TextTrackCue-and-fix-link-in-VTTCue.w.patch Please use the checkin-needed bug keyword to request checkin once this patch has gotten reviewed.
Attachment #8633739 - Flags: checkin?(rick.eyre)
Attachment #8633739 - Flags: review?(rick.eyre) → review?(giles)
Comment on attachment 8633739 [details] [diff] [review] 0001-Add-WebIDL-for-TextTrackCue-and-fix-link-in-VTTCue.w.patch Review of attachment 8633739 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for working on this. Looks good, r=me for media with the whatwg citation updated. The WebIDL changes also need dom peer review. Adding bz for that. ::: dom/webidl/TextTrackCue.webidl @@ +3,5 @@ > + * License, v. 2.0. If a copy of the MPL was not distributed with this file, > + * You can obtain one at http://mozilla.org/MPL/2.0/. > + * > + * The origin of this IDL file is > + * http://www.whatwg.org/specs/web-apps/current-work/#texttrackcue Current url for this is https://html.spec.whatwg.org/#texttrackcue
Attachment #8633739 - Flags: review?(giles)
Attachment #8633739 - Flags: review?(bzbarsky)
Attachment #8633739 - Flags: review+
Comment on attachment 8633739 [details] [diff] [review] 0001-Add-WebIDL-for-TextTrackCue-and-fix-link-in-VTTCue.w.patch This pref is enabled by default, right? Don't you need to update dom/tests/mochitest/general/test_interfaces.html accordingly? r=me assuming we've decided to add this interface....
Attachment #8633739 - Flags: review?(bzbarsky) → review+
Yes, webvtt is enabled by default. As the try build shows, test_interfaces needs updating. Brendan, please update your patch to pass test_interfaces.html and attach it here. That version should be ready to land. Need-info me or add 'checkin-needed' to the keyword field when you're ready. You can verify locally with: ./mach mochitest dom/tests/mochitest/general/test_interfaces.html Also, the first line of your commit message needs to reference the bug number and reviewers. E.g.: Bug 909993 - Add WebIDL for TextTrackCue and fix link in VTTCue.webidl. r=rillian,bz
Assignee: nobody → self
Flags: needinfo?(self)
Updated the VTTCue WebIDL link, fixed test_interfaces, and changed the commit message.
Flags: needinfo?(self) → needinfo?(giles)
Attachment #8633739 - Attachment is obsolete: true
Oops. Didn't think to run these on try. Sorry. The good news is that the problems are all expected-fail tests we now pass, so you just need to update the web platform tests to reflect that we now comply with the spec. E.g. in https://github.com/mozilla/gecko-dev/blob/master/testing/web-platform/meta/html/dom/interfaces.html.ini#L1276 You can verify locally with './mach web-platform-tests'.
Flags: needinfo?(giles)
I just want to mention why this test was failing since it might be confusing: 14:51:57 INFO - TEST-UNEXPECTED-PASS | /html/semantics/embedded-content/media-elements/historical.html | TextTrackCue constructor should not be supported - expected FAIL The TextTrackCue constructor still doesn't exist, but now it (correctly) throws a TypeError instead of a ReferenceError.
Flags: needinfo?(self)
I fixed the two .ini files, and I'm rebuilding to make sure this still applies well and I'll upload again after lunch.
Ok, I fixed the two .ini files and re-ran the web-platform-tests in html/semantics and html/dom (running all of them would take days on my laptop...).
Attachment #8638847 - Attachment is obsolete: true
Flags: needinfo?(giles)
Green on try with mochitests and web platform tests.
Keywords: checkin-needed
This bug is fixed, but for some reason I don't see a RESOLVED: FIXED option for the status.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
This bug is not fixed because it hasn't merged to the main integration branch yet. When it does that, it will be marked fixed. I've changed your bugzilla permissions so you should be able to modify the state of bugs arbitrarily; you should now see a "FIXED" option.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Oops I didn't mean to change the resolved state when I made that comment. I'll just wait for it to be merged then. Thanks for your help!
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: