mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 08:48:07 +00:00
Fixing bug 310825. Prevent window.focus() when called from a background tab from moving focus to the background tab. r=mrbkap@gmail.com, sr=dveditz@cruzio.com
This commit is contained in:
parent
a05a208a0d
commit
b9f159aee3
@ -3402,6 +3402,18 @@ nsGlobalWindow::Focus()
|
||||
{
|
||||
FORWARD_TO_OUTER(Focus, (), NS_ERROR_NOT_INITIALIZED);
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(mDocShell);
|
||||
|
||||
PRBool isVisible = PR_FALSE;
|
||||
if (baseWin) {
|
||||
baseWin->GetVisibility(&isVisible);
|
||||
}
|
||||
|
||||
if (!isVisible) {
|
||||
// A hidden tab is being focused, ignore this call.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* If caller is not chrome and dom.disable_window_flip is true,
|
||||
* prevent bringing a window to the front if the window is not the
|
||||
|
Loading…
x
Reference in New Issue
Block a user