Commit Graph

49 Commits

Author SHA1 Message Date
Ehsan Akhgari
968a1472a5 Bug 1024459 - Define an out of line destructor for TextTrack so that we can forward delcare HTMLTrackElement in TextTrack.h; r=bzbarsky
This is required because the destructor for the nsRefPtr<HTMLTrackElement>
member requires the full definition of the type.
2014-06-14 22:53:52 -04:00
Birunthan Mohanathas
c8c6722bb4 Bug 900903 - Part 2: Change uses of numbered macros in nsCycleCollectionParticipant.h to the variadic variants. r=smaug 2014-04-25 12:49:00 -04:00
Rick Eyre
5433bf6d01 Bug 976580 - Set cue state to dirty when video resize happens. r=rillian, r=bz
This way when the video is resized the rendering algorithm for the cues
will run again and hence, the caption size will be increased/decreased
for the new size of the video.
2014-04-07 15:42:33 -04:00
Rick Eyre
47dcbf2ce9 Bug 950308 - TextTrack, TextTrackCue, TextTrackList should BindToOwner. r=smaug 2014-04-07 13:58:38 -04:00
Boris Zbarsky
fdbb455d4f Bug 991742 part 8. Remove the "aScope" argument of WebIDL/nsWrapperCache WrapObject() methods. r=bholley
This patch was mostly generated with the following command:

find . -name "*.h" -o -name "*.cpp" | xargs sed -e '/WrapObject(JSContext/ {; N; s/\(WrapObject(JSContext *\* *a\{0,1\}[Cc]x\),\n\{0,1\} *JS::Handle<JSObject\*> a\{0,1\}[sS]cope/\1/ ; }' -i ""

and then reverting the changes that made to
dom/bindings/BindingUtils.h, since those WrapObject methods are not
the ones we're trying to change here, plus a bunch of manual fixups
for cases that this command did not catch (including all the callsites
of WrapObject()).
2014-04-08 18:27:18 -04:00
Boris Zbarsky
3f26a82832 Bug 991742 part 6. Remove the "aScope" argument of binding Wrap() methods. r=bholley
This patch was mostly generated with this command:

find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""

plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.
2014-04-08 18:27:17 -04:00
Rick Eyre
41a90c6dc2 Bug 879431 - Set VTTCue's TextTrack from TextTrack::AddCue r=rillian
We were having an issue where the cue's track property was undefined
because it was never set when adding the cue to a text track's list
of cues.
2014-04-02 18:16:00 +02:00
Rick Eyre
f81ce9b4cf Bug 882677 - Part 1: Dispatch loaded and error events to the HTMLTrackElement. r=cpearce 2014-03-14 12:13:41 -04:00
Masayuki Nakano
b185105992 Bug 984269 Rename nsDOMEventTargetHelper to mozilla::DOMEventTargetHelper r=smaug
--HG--
rename : dom/events/nsDOMEventTargetHelper.cpp => dom/events/DOMEventTargetHelper.cpp
rename : dom/events/nsDOMEventTargetHelper.h => dom/events/DOMEventTargetHelper.h
2014-04-01 15:13:50 +09:00
Rick Eyre
a0b716dca0 Bug 891381 - Tracks loaded via TrackElement should have the same id as the TrackElement. r=cpearce 2014-03-19 11:27:39 -04:00
Rick Eyre
ca6fa01a7e Bug 985484 - Remove TextTrackCue::CueChange. r=cpearce 2014-03-19 11:01:38 -04:00
Rick Eyre
dce4674300 Bug 983293 - Part 5: Remove unecessary default settings in TextTrack ctors. r=cpearce
Since there is no default constructor for TextTrack we don't
need to be setting mKind, mMode, or mReadyState to a default
value.
2014-03-13 14:58:08 -04:00
Rick Eyre
4b465b49a2 Bug 983293 - Part 4: Pass ReadyState variables to AddTextTrack methods and TextTrack ctors. r=cpearce
This makes it more clear what part of the code is triggering the ReadyState
to be what it is. I.E. Tracks added through the HTMLMediaElement::AddTextTrack
method should have a ReadyState of "Loaded" and so it's more clear for
function to specify that. Vice versa for TrackElements which add TextTracks
with a default ReadyState of "None".
2014-03-13 14:41:21 -04:00
Rick Eyre
fffd5328cf Bug 983293 - Part 3: Rename the READY_STATE enum to TextTrackReadyState. r=cpearce
- This allows us to pass around ReadyState values. It also makes the type
explicit which will save us from potentially shooting ourselves in
the foot.
- I also renamed 'READY_STATE_NONE' and 'READY_STATE_ERROR' to
'NotLoaded' and 'FailedToLoad' respectively in the enum. This is to
avoid some name collision errors we were having. It also makes it more
clear where in the spec this is as these names are the spec's names
for the TextTrack enum.
2014-03-13 14:29:32 -04:00
Rick Eyre
70894a38c2 Bug 983293 - Part 2: Move the READY_STATE enum to Track instead of HTMLTrackElement. r=cpearce
This makes more sense as the READY_STATE values in the spec are always
referred to be 'text track readiness states' not HTMLTrackElement
readiness states.
2014-03-13 13:48:09 -04:00
Rick Eyre
182212791c Bug 983293 - Part 1: Remove unused TextTrack constructor. r=cpearce 2014-03-13 13:37:31 -04:00
Rick Eyre
2e37168e82 Bug 983207 - Tracks created through a TrackElement should have a default mode of 'disabled'. r=cpearce
- I've refactored the way we set modes as well, making it a part
of the TextTrack ctors.
- I've also changed TextTracks in the track tests to have their
mode set to 'hidden' in order to be able to call TextTrack::Cues.
This is correct since TextTracks with a mode of 'disabled' do not
return null for their cue lists.
2014-03-13 13:18:06 -04:00
Rick Eyre
cf709f8952 Bug 882664 - Part 2: Perform sorting on TextTrackLists. r=rillian
- This implements sorting on the MediaElement's list of TextTracks as
described in: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-model
This is important as automatically positioned cues will have a line
position that is relative to their TextTrack's position in the
MediaElement's list of TextTracks.
- Added a TextTrackSource enum which all TextTracks have. This helps
distinguish where a TextTrack came from.
2014-02-27 12:47:23 -05:00
Rick Eyre
e05bee01c8 Bug 882664 - Part 1: TextTrack should hold a ref to its TrackElement, if any. r=rillian 2014-02-27 14:07:39 -05:00
Rick Eyre
e5a8933985 Bug 978163 - Part 1: Remove VTTRegionList and VTTRegion TextTrack extensions. r=rillian, r=bz
- These two parts of the spec were recently removed as they
were seen as unecessary or bad design, in the case of the
VTTRegion TextTrack extensions. See the spec bug at:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24380
2014-03-10 11:33:06 -04:00
Rick Eyre
8207a58580 Bug 969506 - TextTrack's ActiveCues should return null of TextTrack's mode is set to 'disabled'. r=rillian 2014-02-07 13:59:26 -05:00
Rick Eyre
bbede675f5 Bug 881976 - Part 3: Refactor TextTrack classes. r=rillian
Change the way they store references to eachother to make more sense.
A Track will never belong to a MediaElement directly. It will always
belong to one through a TextTrackList.
2014-01-27 15:17:20 -05:00
Rick Eyre
f29b2ae1a1 Bug 881976 - Part 1: Expose TextTrack::TextTrackList to Chrome JS. r=rillian, r=bz
Our JS WebVTT implementation (vtt.js) needs access to the Track's
TextTrackList in order to compute the line position of a TextTrackCue.
Therefore, we need to expose it to chrome JS so that vtt.js can have
access to it.
2014-01-27 13:10:06 -05:00
Chris Pearce
83582bbc3b Bug 961885 - Rename the enum entries for HTMLTrackElement.readyState, as HTMLTrackElement::ERROR is defined in some other file that can be included in unified builds, causing errors when we add more files to content/media. r=rillian 2014-01-23 17:19:34 +13:00
Rick Eyre
acf78892f7 Bug 957847 - Fix VTTCue crash at TextTrackCue::AddCue. r=rillian 2014-01-15 11:30:58 -05:00
Rick Eyre
78e1d23095 Bug 865407 - Part 5: Move update display of cues code to TextTrackManager. r=bz, r=rillian 2013-12-12 12:02:17 -05:00
Rick Eyre
bc2db591c5 Bug 865407 - Part 3: Add TextTrackList::GetAllActiveCues(). r=rillian 2013-12-12 10:57:21 -05:00
Ryan VanderMeulen
d65ecca981 Backed out 5 changesets (bug 865407) for Windows crashes.
Backed out changeset d3e7f6392670 (bug 865407)
Backed out changeset 7ba94f08b7a5 (bug 865407)
Backed out changeset 3de6e32a4346 (bug 865407)
Backed out changeset 5c0572c6727b (bug 865407)
Backed out changeset 5db43cac79f5 (bug 865407)
2014-01-10 11:50:49 -05:00
Rick Eyre
7b7b323893 Bug 865407 - Part 5: Move update display of cues code to TextTrackManager. r=bz, r=rillian 2013-12-12 12:02:17 -05:00
Rick Eyre
cabf0b003d Bug 865407 - Part 3: Add TextTrackList::GetAllActiveCues(). r=rillian 2013-12-12 10:57:21 -05:00
Andrew Quartey
985efe81df Bug 882718 - Part a: Add list of newly introduced cues to TextTrackManager. r=rillian 2014-01-06 13:03:50 -05:00
Rick Eyre
2488f7f69c Bug 921484 - Fix bugs found in TextTrack::GetActiveCues(); r=rillian
* mDirty needs to be set to false after the list has been recomputed.
* The loop that adds cues to the list doesn't work properly when the
  list has become dirty as we check if endTime < playback time and
  since we start from pos 0 we will never get past the first cue.
2013-12-13 10:09:33 -05:00
Brendan Long
2d0fd1214e Bug 882703 - Add TextTrackList change event; r=rillian,bz 2013-12-17 23:19:09 -06:00
Wes Kocher
e1b2f4d192 Backed out changeset 9ca7e64ef0d0 (bug 921484) 2013-12-20 18:32:44 -08:00
Rick Eyre
afef117451 Bug 921484 - Fix bugs found in TextTrack::GetActiveCues(). r=rillian 2013-12-13 10:09:33 -05:00
Andrew Quartey
43d98eabcb Bug 893880 - Check TextTrackCueList before trying to update its cues. r=rillian 2013-10-28 22:18:35 -04:00
Andrew Quartey
f1ca7b2f1f Bug 931453 - Ensure TextTrack's media element reference is not null. r=khuey 2013-10-28 12:32:51 -04:00
Andrew Quartey
4e8364ae03 Bug 882665 - Part b: Add list of pending text tracks to TextTrackManager. r=rillian, khuey 2013-10-25 00:14:36 -04:00
Andrew Quartey
df20c7ff7e Bug 882665 - Part a: Add readiness state attribute to text track. r= rillian, khuey 2013-10-25 00:14:36 -04:00
Rick Eyre
aa7b64a716 Bug 920088 - TextTrackRegion's TextTrack should point at the correct TextTrack. r=rillian 2013-09-24 11:59:17 -04:00
Rick Eyre
5939f3d97a Bug 883173 - Part 3: Implement TextTrack::ActiveCues. r=cpearce, r=rillian
- Active cues now returns the subset of cues in mCueList that are valid
for the current playback time.
- Introduces new code in media element, when seeking, and in TextTrack, when
adding and removing cues, to mark the active cue list as dirty so that we know
when we might need to rebuild the list completely.
2013-06-14 16:10:36 -04:00
Rick Eyre
df20f6e5b2 Bug 867823 - Implement TextTrack Add/RemoveCue. r=rillian
- Updated RemoveCue to throw NotFoundError if the cue being removed is
not in the cue list.
- Updated AddCue to not add cues that are already in the list. This is
done by reference comparing.
2013-06-28 13:31:43 -04:00
Andrew Quartey
f3572c47b5 Bug 897504 - Implement region API for Gecko. r=giles, khuey 2013-09-13 19:44:33 -04:00
Ehsan Akhgari
3b48889d78 Bug 912702 - Minimize the #includes in content/media; r=roc 2013-09-05 16:25:17 -04:00
Ehsan Akhgari
22fac42fb0 Backed out changeset 2f15518f566e (bug 912702) because of B2G JB Emulator build bustage
--HG--
extra : rebase_source : 6c01ad3bc2f91b0e7e3edab84aedbfe064310a8b
2013-09-05 13:29:38 -04:00
Ehsan Akhgari
2ce2ec0cdb Bug 912702 - Minimize the #includes in content/media; r=roc 2013-09-04 17:58:14 -04:00
Rick Eyre
7b90a3a973 Bug 905320 - Fix TextTrack classes to utilize cycle collection correctly. r=khuey
We were incorrectly using the wrapper cache cycle collection macros when that
functionality was already implemented by the base classes. Therefore, we
should instead use the inherited version of the cycle collection macros.
2013-08-15 11:11:15 -04:00
Rick Eyre
3800bbb044 Bug 833382 - Implement WebVTTLoadListener r=cpearce,bz
- Implemented WebVTTLoadListener to manage the webvtt parser.
- TextTrackCue now handles the conversion of webvtt nodes to
  anonymous content which will be displayed on the video div
  overlay.
- HTMLTrackElement manages the lifetime of the WebVTTLoadListener.
2013-06-10 08:30:00 -07:00
Ralph Giles
3d52d52549 Bug 833385 - Implement HTMLTrackElement and TextTrack. r=bz,Ms2ger
Add webidl interfaces and implementations of the HTML <track>
element and related TextTrack, TextTrackList, TextTrackCue,
and TextTrackCueList dom objects.

Visibility is controlled by the media.webvtt.enabled pref,
which defaults to false.

HTMLMediaElement:NewURIFromString() is hoisted to
nsGenericHTMLElement so it's available to the track
element as well.

This patch is primarily work by Dale Karp, David Humphrey
and others as Seneca College.
2013-05-22 00:14:00 +08:00