Closed Bug 867823 Opened 12 years ago Closed 12 years ago

[webvtt] implement TextTrack cue add/remove

Categories

(Core :: Audio/Video, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: rillian, Assigned: reyre)

References

()

Details

(Keywords: dev-doc-needed)

Attachments

(1 file, 3 obsolete files)

Placeholder for XXX commments in bug 833385. - Handle de-dup in TextTrack::AddCue - Throw NotFoundError on invalid remove (https://github.com/RickEyre/mozilla-central/commit/0826f21201e08153cad744a6cb54ed6a25303e5c) - Implement TextTrack::CueChanged event.
Blocks: 882700
No longer blocks: webvtt
Assignee: nobody → rick.eyre
Status: NEW → ASSIGNED
Right now I'm comparing cues via reference comparing. So if two cues with the exact same data are added it won't catch it. I don't know if we want it this way or not. I've left out all the logic in TextTrack::AddCue that deals with the abstraction of TextTrackCues and WebVTTCues as we're currently not supporting that.
Attachment #769039 - Flags: review?(giles)
Comment on attachment 769039 [details] [diff] [review] v1: Implement TextTrack Add/RemoveCue Review of attachment 769039 [details] [diff] [review]: ----------------------------------------------------------------- Looks ok to me. I don't see that the spec defines how to compare cues, so comparing by reference seems fine for now. I asked for clarification on #whatwg. You could presumedly compare by value just by implementing operator== on TextTrackCue. I do note the spec specifies replacement rather than skipping the add when addCue() is called with a duplicate cue. That's equivalent when you're comparing by value, but you should probably as a comment explaining it's an optimization in case we change it later and forget.
Attachment #769039 - Flags: review?(giles) → review+
What about tests?
(In reply to Ralph Giles (:rillian) from comment #2) > Looks ok to me. I don't see that the spec defines how to compare cues, so > comparing by reference seems fine for now. I asked for clarification on > #whatwg. Hixie just responded that we should be comparing by "identity (ref)" which I would think is comparing by reference. So I think we're good for now. > You could presumedly compare by value just by implementing operator== on > TextTrackCue. I do note the spec specifies replacement rather than skipping > the add when addCue() is called with a duplicate cue. That's equivalent when > you're comparing by value, but you should probably as a comment explaining > it's an optimization in case we change it later and forget. I'll add in a comment about why we don't do it just to make sure, like you suggest. (In reply to Ralph Giles (:rillian) from comment #3) > What about tests? I'll add those in as well. I'll try to put a patch up for this bug as soon as I can, it might come sometime later next week depending on how the parser writing goes. Thanks for the review Ralph.
I've re-enabled the text track cue tests that were set as todo. Is this fine for tests Ralph?
Attachment #769039 - Attachment is obsolete: true
Attachment #807783 - Flags: review?(giles)
Comment on attachment 807783 [details] [diff] [review] v2: Implement TextTrack Add/RemoveCue Review of attachment 807783 [details] [diff] [review]: ----------------------------------------------------------------- Yep, I can't think of anything else to test here. r=me with doc nits. ::: content/media/test/test_texttrackcue.html @@ -83,4 @@ > is(cue.endTime, 4, "Cue's end time should be 4."); > is(cue.text, "foo", "Cue's text should be foo."); > > - // Adding the same cue again should not increase the cue count. Please keep the first line of this comment, or say something similar in the assert. @@ +98,2 @@ > } catch (e) { > + is(e.name, "NotFoundError", "We should have caught an error."); "Should have thrown NotFoundError."
Attachment #807783 - Flags: review?(giles) → review+
Thanks for review Ralph. Carrying forward r=rillian.
Attachment #807783 - Attachment is obsolete: true
Updating commit message to contain r=rillian.
Attachment #808070 - Attachment is obsolete: true
Looks green.
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: