зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 883bfabfde46 (bug 882718)
This commit is contained in:
Родитель
db844b8bcb
Коммит
de05b7902e
|
@ -3740,13 +3740,13 @@ void HTMLMediaElement::SeekCompleted()
|
|||
{
|
||||
mPlayingBeforeSeek = false;
|
||||
SetPlayedOrSeeked(true);
|
||||
if (mTextTrackManager) {
|
||||
mTextTrackManager->DidSeek();
|
||||
}
|
||||
FireTimeUpdate(false);
|
||||
DispatchAsyncEvent(NS_LITERAL_STRING("seeked"));
|
||||
// We changed whether we're seeking so we need to AddRemoveSelfReference
|
||||
AddRemoveSelfReference();
|
||||
if (mTextTrackManager) {
|
||||
mTextTrackManager->DidSeek();
|
||||
}
|
||||
if (mCurrentPlayRangeStart == -1.0) {
|
||||
mCurrentPlayRangeStart = CurrentTime();
|
||||
}
|
||||
|
|
|
@ -193,7 +193,8 @@ TextTrackManager::RemoveTextTrack(TextTrack* aTextTrack, bool aPendingListOnly)
|
|||
TextTrackCueList* removeCueList = aTextTrack->GetCues();
|
||||
if (removeCueList) {
|
||||
for (uint32_t i = 0; i < removeCueList->Length(); ++i) {
|
||||
mNewCues->RemoveCue(*((*removeCueList)[i]));
|
||||
ErrorResult dummyRv;
|
||||
mNewCues->RemoveCue(*((*removeCueList)[i]), dummyRv);
|
||||
}
|
||||
DispatchTimeMarchesOn();
|
||||
}
|
||||
|
@ -205,9 +206,6 @@ TextTrackManager::DidSeek()
|
|||
if (mTextTracks) {
|
||||
mTextTracks->DidSeek();
|
||||
}
|
||||
if (mMediaElement) {
|
||||
mLastTimeMarchesOnCalled = mMediaElement->CurrentTime();
|
||||
}
|
||||
mHasSeeked = true;
|
||||
}
|
||||
|
||||
|
@ -266,7 +264,8 @@ void
|
|||
TextTrackManager::NotifyCueRemoved(TextTrackCue& aCue)
|
||||
{
|
||||
if (mNewCues) {
|
||||
mNewCues->RemoveCue(aCue);
|
||||
ErrorResult dummyRv;
|
||||
mNewCues->RemoveCue(aCue, dummyRv);
|
||||
}
|
||||
DispatchTimeMarchesOn();
|
||||
}
|
||||
|
@ -533,8 +532,7 @@ TextTrackManager::TimeMarchesOn()
|
|||
}
|
||||
nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(parentObject);
|
||||
|
||||
if (mMediaElement &&
|
||||
(!(mMediaElement->GetPlayedOrSeeked())|| mMediaElement->Seeking())) {
|
||||
if (mMediaElement && !(mMediaElement->GetPlayedOrSeeked())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -572,7 +570,8 @@ TextTrackManager::TimeMarchesOn()
|
|||
}
|
||||
for (uint32_t i = 0; i < currentCues->Length(); ++i) {
|
||||
TextTrackCue* cue = (*currentCues)[i];
|
||||
otherCues->RemoveCue(*cue);
|
||||
ErrorResult dummy;
|
||||
otherCues->RemoveCue(*cue, dummy);
|
||||
}
|
||||
|
||||
// Step 4.
|
||||
|
@ -697,10 +696,6 @@ TextTrackManager::TimeMarchesOn()
|
|||
TextTrack* ttrack = affectedTracks[i];
|
||||
if (ttrack) {
|
||||
ttrack->DispatchTrustedEvent(NS_LITERAL_STRING("cuechange"));
|
||||
HTMLTrackElement* trackElement = ttrack->GetTrackElement();
|
||||
if (trackElement) {
|
||||
trackElement->DispatchTrackRunnable(NS_LITERAL_STRING("cuechange"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -160,6 +160,10 @@ TextTrack::UpdateActiveCueList()
|
|||
return;
|
||||
}
|
||||
|
||||
// Flag that indicates whether or not this call of UpdateActiveCueList has
|
||||
// changed the activeCueList.
|
||||
bool hasChanged = false;
|
||||
|
||||
// If we are dirty, i.e. an event happened that may cause the sorted mCueList
|
||||
// to have changed like a seek or an insert for a cue, than we need to rebuild
|
||||
// the active cue list from scratch.
|
||||
|
@ -175,6 +179,7 @@ TextTrack::UpdateActiveCueList()
|
|||
for (uint32_t i = mActiveCueList->Length(); i > 0; i--) {
|
||||
if ((*mActiveCueList)[i - 1]->EndTime() < playbackTime) {
|
||||
mActiveCueList->RemoveCueAt(i - 1);
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
// Add all the cues, starting from the position of the last cue that was
|
||||
|
@ -185,6 +190,16 @@ TextTrack::UpdateActiveCueList()
|
|||
(*mCueList)[mCuePos]->StartTime() <= playbackTime; mCuePos++) {
|
||||
if ((*mCueList)[mCuePos]->EndTime() >= playbackTime) {
|
||||
mActiveCueList->AddCue(*(*mCueList)[mCuePos]);
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasChanged) {
|
||||
RefPtr<AsyncEventDispatcher> asyncDispatcher =
|
||||
new AsyncEventDispatcher(this, NS_LITERAL_STRING("cuechange"), false);
|
||||
asyncDispatcher->PostDOMEvent();
|
||||
if (mTrackElement) {
|
||||
mTrackElement->DispatchTrackRunnable(NS_LITERAL_STRING("cuechange"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,12 +103,6 @@ TextTrackCueList::RemoveCue(TextTrackCue& aCue, ErrorResult& aRv)
|
|||
mList.RemoveElement(&aCue);
|
||||
}
|
||||
|
||||
void
|
||||
TextTrackCueList::RemoveCue(TextTrackCue& aCue)
|
||||
{
|
||||
mList.RemoveElement(&aCue);
|
||||
}
|
||||
|
||||
void
|
||||
TextTrackCueList::RemoveCueAt(uint32_t aIndex)
|
||||
{
|
||||
|
|
|
@ -50,7 +50,6 @@ public:
|
|||
// from the end of the current array should be more efficient than a general
|
||||
// sort step after all cues are loaded.
|
||||
void AddCue(TextTrackCue& aCue);
|
||||
void RemoveCue(TextTrackCue& aCue);
|
||||
void RemoveCue(TextTrackCue& aCue, ErrorResult& aRv);
|
||||
void RemoveCueAt(uint32_t aIndex);
|
||||
void RemoveAll();
|
||||
|
|
|
@ -83,10 +83,6 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.regions.enabled", true]]},
|
|||
is(cue.endTime, 0.71, "Cue's end time should be 0.71.");
|
||||
cue.pauseOnExit = true;
|
||||
is(cue.pauseOnExit, true, "Cue's pause on exit flag should be true.");
|
||||
video.addEventListener("pause", function pauseOnExit() {
|
||||
video.removeEventListener("pause", pauseOnExit, false);
|
||||
video.play();
|
||||
});
|
||||
|
||||
var exceptionHappened;
|
||||
function checkPercentageValue(prop) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче