diff --git a/dom/html/TextTrackManager.cpp b/dom/html/TextTrackManager.cpp index 9de664084274..b39628dd8dcb 100644 --- a/dom/html/TextTrackManager.cpp +++ b/dom/html/TextTrackManager.cpp @@ -145,7 +145,7 @@ TextTrackManager::AddTextTrack(TextTrackKind aKind, const nsAString& aLabel, AddCues(ttrack); if (aTextTrackSource == Track) { - HonorUserPreferencesForTrackSelection(); + NS_DispatchToMainThread(NewRunnableMethod(this, &TextTrackManager::HonorUserPreferencesForTrackSelection)); } return ttrack.forget(); @@ -160,7 +160,7 @@ TextTrackManager::AddTextTrack(TextTrack* aTextTrack) mTextTracks->AddTextTrack(aTextTrack, CompareTextTracks(mMediaElement)); AddCues(aTextTrack); if (aTextTrack->GetTextTrackSource() == Track) { - HonorUserPreferencesForTrackSelection(); + NS_DispatchToMainThread(NewRunnableMethod(this, &TextTrackManager::HonorUserPreferencesForTrackSelection)); } } diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html index 11d33b771165..4b7808c96389 100644 --- a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html +++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html @@ -79,7 +79,7 @@ async_test(function(){ var video = document.createElement('video'); var t1 = video.addTextTrack('subtitles'); var t1_cues = t1.cues; - t1.mode = 'showing'; + t1.mode = 'hidden'; var track = document.createElement('track'); track['default'] = true; video.appendChild(track); // queues a task to "honor user preferences...", media element event task source