Bug 1284350. Reland on top of backouts "Bug 1299065 - invisible elements in the foreground should also be recorded; r=gerald" r=kaku

Instead of "not visible", "approximately visible", and "visible" (in display port) we now have "approximately not visible", and "approximately visible" which includes "visible".
This commit is contained in:
Kaku Kuo
2016-08-30 14:53:04 +08:00
parent 666be0ef8d
commit 90a343f11f

View File

@@ -6049,10 +6049,18 @@ HTMLMediaElement::OnVisibilityChange(Visibility aNewVisibility)
break;
}
case Visibility::APPROXIMATELY_NONVISIBLE: {
if (mPlayTime.IsStarted()) {
// Not visible, play time is running -> Start hidden play time if needed.
HiddenVideoStart();
}
mDecoder->NotifyOwnerActivityChanged(false);
break;
}
case Visibility::APPROXIMATELY_VISIBLE: {
// Visible -> Just pause hidden play time (no-op if already paused).
HiddenVideoStop();
mDecoder->NotifyOwnerActivityChanged(true);
break;
}