Bug 1509446 - part6 : update cues display without checking whether cue is active or not. r=jya
authorAlastor Wu <alwu@mozilla.com>
Tue, 05 Mar 2019 19:48:31 +0000
changeset 520967 a0d8bc1dab63
parent 520966 057318480b0e
child 520968 b2ad34980053
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1509446
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1509446 - part6 : update cues display without checking whether cue is active or not. r=jya We should update cue display everytime when the cues list changed. In addition, we shouldn't check whether cue is active when we update display, because it's always inactive when the cue has been removed from `TextTrack::RemoveCue()`. Differential Revision: https://phabricator.services.mozilla.com/D21143
dom/html/TextTrackManager.cpp
--- a/dom/html/TextTrackManager.cpp
+++ b/dom/html/TextTrackManager.cpp
@@ -290,20 +290,17 @@ void TextTrackManager::NotifyCueAdded(Te
 }
 
 void TextTrackManager::NotifyCueRemoved(TextTrackCue& aCue) {
   WEBVTT_LOG("NotifyCueRemoved");
   if (mNewCues) {
     mNewCues->RemoveCue(aCue);
   }
   TimeMarchesOn();
-  if (aCue.GetActive()) {
-    // We remove an active cue, need to update the display.
-    DispatchUpdateCueDisplay();
-  }
+  DispatchUpdateCueDisplay();
 }
 
 void TextTrackManager::PopulatePendingList() {
   if (!mTextTracks || !mPendingTextTracks || !mMediaElement) {
     return;
   }
   uint32_t len = mTextTracks->Length();
   bool dummy;