Bug 1108721, HTMLMediaElement.textTracks needs to be nullable in Gecko for now, r=peterv

--HG--
extra : rebase_source : 8c4b0b13e50a200907f1b4ba923fee4165318ca9
This commit is contained in:
Olli Pettay 2015-01-12 13:07:38 +02:00
parent c3bd5ba35d
commit f0befe594b
6 changed files with 15 additions and 17 deletions

View File

@ -4272,11 +4272,11 @@ HTMLMediaElement::VideoTracks()
return mVideoTrackList;
}
/* readonly attribute TextTrackList textTracks; */
/* readonly attribute TextTrackList? textTracks; */
TextTrackList*
HTMLMediaElement::TextTracks()
HTMLMediaElement::GetTextTracks()
{
return GetOrCreateTextTrackManager()->TextTracks();
return GetOrCreateTextTrackManager()->GetTextTracks();
}
already_AddRefed<TextTrack>

View File

@ -579,7 +579,7 @@ public:
VideoTrackList* VideoTracks();
TextTrackList* TextTracks();
TextTrackList* GetTextTracks();
already_AddRefed<TextTrack> AddTextTrack(TextTrackKind aKind,
const nsAString& aLabel,

View File

@ -153,13 +153,12 @@ HTMLTrackElement::CreateTextTrack()
kind = TextTrackKind::Subtitles;
}
bool hasHadScriptObject = true;
nsIScriptGlobalObject* scriptObject =
OwnerDoc()->GetScriptHandlingObject(hasHadScriptObject);
nsISupports* parentObject =
OwnerDoc()->GetParentObject();
NS_ENSURE_TRUE_VOID(scriptObject || !hasHadScriptObject);
NS_ENSURE_TRUE_VOID(parentObject);
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(scriptObject);
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(parentObject);
mTrack = new TextTrack(window, kind, label, srcLang,
TextTrackMode::Disabled,
TextTrackReadyState::NotLoaded,

View File

@ -91,13 +91,12 @@ TextTrackManager::TextTrackManager(HTMLMediaElement *aMediaElement)
: mMediaElement(aMediaElement)
, performedTrackSelection(false)
{
bool hasHadScriptObject = true;
nsIScriptGlobalObject* scriptObject =
mMediaElement->OwnerDoc()->GetScriptHandlingObject(hasHadScriptObject);
nsISupports* parentObject =
mMediaElement->OwnerDoc()->GetParentObject();
NS_ENSURE_TRUE_VOID(scriptObject || !hasHadScriptObject);
NS_ENSURE_TRUE_VOID(parentObject);
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(scriptObject);
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(parentObject);
mNewCues = new TextTrackCueList(window);
mTextTracks = new TextTrackList(window, this);
mPendingTextTracks = new TextTrackList(window, this);
@ -115,7 +114,7 @@ TextTrackManager::~TextTrackManager()
}
TextTrackList*
TextTrackManager::TextTracks() const
TextTrackManager::GetTextTracks() const
{
return mTextTracks;
}

View File

@ -45,7 +45,7 @@ public:
explicit TextTrackManager(HTMLMediaElement* aMediaElement);
TextTrackList* TextTracks() const;
TextTrackList* GetTextTracks() const;
already_AddRefed<TextTrack> AddTextTrack(TextTrackKind aKind,
const nsAString& aLabel,
const nsAString& aLanguage,

View File

@ -91,7 +91,7 @@ interface HTMLMediaElement : HTMLElement {
[Pref="media.track.enabled"]
readonly attribute VideoTrackList videoTracks;
[Pref="media.webvtt.enabled"]
readonly attribute TextTrackList textTracks;
readonly attribute TextTrackList? textTracks;
[Pref="media.webvtt.enabled"]
TextTrack addTextTrack(TextTrackKind kind,
optional DOMString label = "",