Fix for bug 261074: OnFocus fires twice when window restored
r=neil sr=roc a=auto-approved git-svn-id: svn://10.0.0.236/trunk@233491 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
d7023844c5
commit
4a6e4d307b
@ -840,6 +840,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||
break;
|
||||
|
||||
if (mDocument) {
|
||||
PRBool isAlreadySuppressed = PR_FALSE;
|
||||
if (gLastFocusedDocument && gLastFocusedPresContext) {
|
||||
nsCOMPtr<nsPIDOMWindow> ourWindow =
|
||||
gLastFocusedDocument->GetWindow();
|
||||
@ -853,7 +854,6 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||
// Hold a strong ref to the focus controller, since we need
|
||||
// it after event dispatch.
|
||||
nsCOMPtr<nsIFocusController> focusController;
|
||||
PRBool isAlreadySuppressed = PR_FALSE;
|
||||
|
||||
if (ourWindow) {
|
||||
focusController = ourWindow->GetRootFocusController();
|
||||
@ -922,7 +922,7 @@ nsEventStateManager::PreHandleEvent(nsPresContext* aPresContext,
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window(mDocument->GetWindow());
|
||||
|
||||
if (window) {
|
||||
if (window && !isAlreadySuppressed) {
|
||||
// We don't want there to be a focused content node while we're
|
||||
// dispatching the focus event.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user