зеркало из https://github.com/mozilla/gecko-dev.git
Bug 969506 - TextTrack's ActiveCues should return null of TextTrack's mode is set to 'disabled'. r=rillian
This commit is contained in:
Родитель
106bbee041
Коммит
0471b003b2
|
@ -148,7 +148,7 @@ TextTrack::RemoveRegion(const TextTrackRegion& aRegion, ErrorResult& aRv)
|
|||
void
|
||||
TextTrack::UpdateActiveCueList()
|
||||
{
|
||||
if (mMode == TextTrackMode::Disabled || !mTextTrackList) {
|
||||
if (!mTextTrackList) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -188,15 +188,20 @@ TextTrack::UpdateActiveCueList()
|
|||
|
||||
TextTrackCueList*
|
||||
TextTrack::GetActiveCues() {
|
||||
UpdateActiveCueList();
|
||||
return mActiveCueList;
|
||||
if (mMode != TextTrackMode::Disabled) {
|
||||
UpdateActiveCueList();
|
||||
return mActiveCueList;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
TextTrack::GetActiveCueArray(nsTArray<nsRefPtr<TextTrackCue> >& aCues)
|
||||
{
|
||||
UpdateActiveCueList();
|
||||
mActiveCueList->GetArray(aCues);
|
||||
if (mMode != TextTrackMode::Disabled) {
|
||||
UpdateActiveCueList();
|
||||
mActiveCueList->GetArray(aCues);
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t
|
||||
|
|
|
@ -173,6 +173,15 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
|
|||
|
||||
is(cueList.length, 6, "Cue list length should be 6.");
|
||||
|
||||
video.currentTime = 2;
|
||||
isnot(trackElement.track.activeCues, null);
|
||||
|
||||
trackElement.track.mode = "disabled";
|
||||
is(trackElement.track.activeCues, null);
|
||||
|
||||
trackElement.track.mode = "showing";
|
||||
video.currentTime = 0;
|
||||
|
||||
// Test TextTrack::ActiveCues.
|
||||
var cueInfo = [
|
||||
{ startTime: 0.51, endTime: 0.71, ids: ["Cue 01"] },
|
||||
|
|
Загрузка…
Ссылка в новой задаче