- Added vtt.js, a JS WebVTT parser, to Gecko.
- Added a wrapper to interface between it and Gecko.
- Updated TextTrackCue and WebVTTListener to work with it.
--HG--
rename : content/media/WebVTTLoadListener.cpp => content/media/WebVTTListener.cpp
rename : content/media/WebVTTLoadListener.h => content/media/WebVTTListener.h
- Remove left over references to WebVTT C parser in TextTrackCue and
WebVTTListener classes.
- Remove miscellaneous unused code as well and included libraries as
well.
Following up with the changes made in http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical, this patch comes to create a new enum to validate and control the possible values for TextTrackCue::Vertical. Throwing behavior was removed for spec conformance.
This way we can ensure that JS code written for WebVTT is spec
compliant while at the same time not having to abstract VTTCue
from TextTrackCue.
--HG--
rename : dom/webidl/TextTrackCue.webidl => dom/webidl/VTTCue.webidl
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.
From 095c76c72dd5915b2fa8ec74f4e2b0b45de244f1 Mon Sep 17 00:00:00 2001
Since we keep a document reference we no longer need the
separate global. It was only used in GetParentObject() and
we can return nullptr there (meaning 'use whatever magic global')
or return the document instead, which is what this patch does.
From 447985000db919e2f054012ca10f03d626c401b1 Mon Sep 17 00:00:00 2001
r=bz
Save a copy of the owning document at creation time instead
of looking it up from mGlobal in each call. This ensures it
is available even if we're called after our window is unlinked
at teardown.
Make the constructors throw if a window is not available,
so we can return an INVALID_STATE_ERR if we're called
in an incomplete environment.
- Renamed mCueDiv to mDisplayState to match spec.
- Introduced mReset which is set whenever TextTrackCue changes in
a way that will mean we have to rebuild the computed cuetext of the
TextTrackCue.
Find nsIDocument via mGlobal (as nsPIDOMWindow) rather than via pointer to
HTMLTrackElement. (bz from #content has explained how we can access
nsPIDOMWindow and nsIDocument without having to ask the HTMLTrackElement)
For the time being, there are many null-ness checks for both 'window' and
'document', and no mechanism to report errors other than returning nullptr
where possible. This will be addressed in a followup bug.
Also adds a test for mHead nullness in TextTrackCue::ConvertNodeTreeToDOMTree
to prevent SIGSEV.
- 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.
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.