зеркало из https://github.com/mozilla/gecko-dev.git
stifle infinite focus/activation recursion. bug 124299 r=hyatt,jst
This commit is contained in:
Родитель
6b24a50e0a
Коммит
7b2e210da6
|
@ -79,6 +79,7 @@ static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
|
|||
nsWebBrowser::nsWebBrowser() : mDocShellTreeOwner(nsnull),
|
||||
mInitInfo(nsnull),
|
||||
mContentType(typeContentWrapper),
|
||||
mActivating(PR_FALSE),
|
||||
mParentNativeWindow(nsnull),
|
||||
mProgressListener(nsnull),
|
||||
mBackgroundColor(0),
|
||||
|
@ -1605,6 +1606,13 @@ NS_IMETHODIMP nsWebBrowser::GetPrimaryContentWindow(nsIDOMWindowInternal **aDOMW
|
|||
/* void activate (); */
|
||||
NS_IMETHODIMP nsWebBrowser::Activate(void)
|
||||
{
|
||||
// stop infinite recursion from windows with onfocus handlers that
|
||||
// reactivate the window
|
||||
if (mActivating)
|
||||
return NS_OK;
|
||||
|
||||
mActivating = PR_TRUE;
|
||||
|
||||
// try to set focus on the last focused window as stored in the
|
||||
// focus controller object.
|
||||
nsCOMPtr<nsIDOMWindow> domWindowExternal;
|
||||
|
@ -1664,6 +1672,7 @@ NS_IMETHODIMP nsWebBrowser::Activate(void)
|
|||
}
|
||||
}
|
||||
|
||||
mActivating = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -137,6 +137,7 @@ protected:
|
|||
nsCOMPtr<nsIWindowWatcher> mWWatch;
|
||||
nsWebBrowserInitInfo* mInitInfo;
|
||||
PRUint32 mContentType;
|
||||
PRBool mActivating;
|
||||
nativeWindow mParentNativeWindow;
|
||||
nsIWebProgressListener *mProgressListener;
|
||||
nsCOMPtr<nsIWebProgress> mWebProgress;
|
||||
|
|
Загрузка…
Ссылка в новой задаче