Bug 906666, treat frozen windows as not visible, so that they don't get focused, r=smaug

This commit is contained in:
Neil Deakin 2013-12-23 09:24:36 -05:00
parent 35f59dc30c
commit 5631de9296

View File

@ -1379,7 +1379,13 @@ nsFocusManager::AdjustWindowFocus(nsPIDOMWindow* aWindow,
bool
nsFocusManager::IsWindowVisible(nsPIDOMWindow* aWindow)
{
if (!aWindow)
if (!aWindow || aWindow->IsFrozen())
return false;
// Check if the inner window is frozen as well. This can happen when a focus change
// occurs while restoring a previous page.
nsPIDOMWindow* innerWindow = aWindow->GetCurrentInnerWindow();
if (!innerWindow || innerWindow->IsFrozen())
return false;
nsCOMPtr<nsIDocShell> docShell = aWindow->GetDocShell();