Bug 1347892 part 3 - dont change video decode mode if a media element is in-tree with UNTRACKED visibility state; r?jwwang
If a media element is in-tree with UNTRACKED visibility state, the information is incomplete, just ignore it.
MozReview-Commit-ID: FcKybQZqF6c
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1310,16 +1310,22 @@ MediaDecoder::SetSuspendTaint(bool aTain
void
MediaDecoder::UpdateVideoDecodeMode()
{
// The MDSM may yet be set.
if (!mDecoderStateMachine) {
return;
}
+ // If an element is in-tree with UNTRACKED visibility, the visibility is
+ // incomplete and don't update the video decode mode.
+ if (mIsElementInTree && mElementVisibility == Visibility::UNTRACKED) {
+ return;
+ }
+
// If mHasSuspendTaint is set, never suspend the video decoder.
if (mHasSuspendTaint) {
mDecoderStateMachine->SetVideoDecodeMode(VideoDecodeMode::Normal);
return;
}
// Don't suspend elements that is not in tree.
if (!mIsElementInTree) {