Bug 1727514 - media playback should stop in the bfcache, r=peterv
SetContainer handling is similar to what DocumentViewer does for the old bfcache implementation. (The old implementation hides it quite well). The changes to HTMLMediaElement are needed to ensure page can enter bfcache. Removed erroneous MOZ_ASSERT in nsPresContext, it is ok to trigger that code path in the new implementation. And the Run() method of the relevant nsIRunnable already deals with that case. Differential Revision: https://phabricator.services.mozilla.com/D124684
This commit is contained in:
@@ -2566,10 +2566,6 @@ void HTMLMediaElement::SelectResource() {
|
||||
!mIsLoadingFromSourceChildren,
|
||||
"Should think we're not loading from source children by default");
|
||||
|
||||
if (!mMediaSource) {
|
||||
OwnerDoc()->AddMediaElementWithMSE();
|
||||
}
|
||||
|
||||
RemoveMediaElementFromURITable();
|
||||
if (!mSrcMediaSource) {
|
||||
mLoadingSrc = uri;
|
||||
@@ -2579,7 +2575,11 @@ void HTMLMediaElement::SelectResource() {
|
||||
mLoadingSrcTriggeringPrincipal = mSrcAttrTriggeringPrincipal;
|
||||
DDLOG(DDLogCategory::Property, "loading_src",
|
||||
nsCString(NS_ConvertUTF16toUTF8(src)));
|
||||
bool hadMediaSource = !!mMediaSource;
|
||||
mMediaSource = mSrcMediaSource;
|
||||
if (mMediaSource && !hadMediaSource) {
|
||||
OwnerDoc()->AddMediaElementWithMSE();
|
||||
}
|
||||
DDLINKCHILD("mediasource", mMediaSource.get());
|
||||
UpdatePreloadAction();
|
||||
if (mPreloadAction == HTMLMediaElement::PRELOAD_NONE && !mMediaSource) {
|
||||
@@ -2833,16 +2833,16 @@ void HTMLMediaElement::LoadFromSourceChildren() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mMediaSource) {
|
||||
OwnerDoc()->AddMediaElementWithMSE();
|
||||
}
|
||||
|
||||
RemoveMediaElementFromURITable();
|
||||
mLoadingSrc = uri;
|
||||
mLoadingSrcTriggeringPrincipal = childSrc->GetSrcTriggeringPrincipal();
|
||||
DDLOG(DDLogCategory::Property, "loading_src",
|
||||
nsCString(NS_ConvertUTF16toUTF8(src)));
|
||||
bool hadMediaSource = !!mMediaSource;
|
||||
mMediaSource = childSrc->GetSrcMediaSource();
|
||||
if (mMediaSource && !hadMediaSource) {
|
||||
OwnerDoc()->AddMediaElementWithMSE();
|
||||
}
|
||||
DDLINKCHILD("mediasource", mMediaSource.get());
|
||||
NS_ASSERTION(mNetworkState == NETWORK_LOADING,
|
||||
"Network state should be loading");
|
||||
|
||||
Reference in New Issue
Block a user