Bug 1191491 - Do not dispatch an audio-playback notification when swapping browsers; r=smaug
We send a pagehide event during swapping docshell frame loaders, and before this patch we would not be able to differentiate this event with the one that we send when navigating away from a page, so we would incorrectly dispatch an audio-playback notification indicating that audio playback has stopped. This patch adds a flag to the root docshell when the frame loader swapping is in progress and disables the above behavior when that flag is set.
This commit is contained in:
@@ -900,6 +900,7 @@ nsDocShell::nsDocShell()
|
||||
, mUseRemoteTabs(false)
|
||||
, mDeviceSizeIsPageSize(false)
|
||||
, mWindowDraggingAllowed(false)
|
||||
, mInFrameSwap(false)
|
||||
, mCanExecuteScripts(false)
|
||||
, mFiredUnloadEvent(false)
|
||||
, mEODForCurrentDocument(false)
|
||||
@@ -14074,3 +14075,16 @@ nsDocShell::GetPaymentRequestId(nsAString& aPaymentRequestId)
|
||||
aPaymentRequestId = GetInheritedPaymentRequestId();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
nsDocShell::InFrameSwap()
|
||||
{
|
||||
nsRefPtr<nsDocShell> shell = this;
|
||||
do {
|
||||
if (shell->mInFrameSwap) {
|
||||
return true;
|
||||
}
|
||||
shell = shell->GetParentDocshell();
|
||||
} while (shell);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user