Bug 1423200 - When setting up a new content viewer, if the previous PresShell was active, make the new one active too. r=mystor
It's possible to RenderLayers for a top-level content process DocShell without that DocShell being active. When we do this, the PresShell for that DocShell becomes active, but the DocShell stays inactive (to avoid accidentally playing paused video or clearing notifications in that DocShell). If a DocShell is inactive but rendering its layers, it's possible for that DocShell to navigate. When this occurs, a new PresShell can be created, which normally reads its active state off of the DocShell. This means that the PresShell will become inactive even though the tab is supposed to continue rendering its layers. This patch checks for PresShell active state when setting up a new content viewer after a navigation, and if the previous PresShell was active, makes the new PresShell active too. MozReview-Commit-ID: KX9HvZJKqg2
This commit is contained in:
@@ -9010,6 +9010,7 @@ nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
|
||||
}
|
||||
|
||||
nscolor bgcolor = NS_RGBA(0, 0, 0, 0);
|
||||
bool isActive = false;
|
||||
// Ensure that the content viewer is destroyed *after* the GC - bug 71515
|
||||
nsCOMPtr<nsIContentViewer> contentViewer = mContentViewer;
|
||||
if (contentViewer) {
|
||||
@@ -9024,6 +9025,7 @@ nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
|
||||
|
||||
if (shell) {
|
||||
bgcolor = shell->GetCanvasBackground();
|
||||
isActive = shell->IsActive();
|
||||
}
|
||||
|
||||
contentViewer->Close(mSavingOldViewer ? mOSHE.get() : nullptr);
|
||||
@@ -9082,6 +9084,9 @@ nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
|
||||
|
||||
if (shell) {
|
||||
shell->SetCanvasBackground(bgcolor);
|
||||
if (isActive) {
|
||||
shell->SetIsActive(isActive);
|
||||
}
|
||||
}
|
||||
|
||||
// XXX: It looks like the LayoutState gets restored again in Embed()
|
||||
|
||||
Reference in New Issue
Block a user