From 97f88188ea656dd79b4c767e35064e4084fd1695 Mon Sep 17 00:00:00 2001 From: "aaronleventhal%moonset.net" Date: Wed, 24 Aug 2005 00:31:24 +0000 Subject: [PATCH] Bug 249136. Focus lost in newly loading foreground tabs. r=mats, sr=bryner --- dom/src/base/nsFocusController.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/src/base/nsFocusController.cpp b/dom/src/base/nsFocusController.cpp index f0a7655374d..82260c43ee8 100644 --- a/dom/src/base/nsFocusController.cpp +++ b/dom/src/base/nsFocusController.cpp @@ -498,8 +498,10 @@ nsFocusController::SetSuppressFocus(PRBool aSuppressFocus, const char* aReason) NS_ASSERTION(PR_FALSE, "Attempt to decrement focus controller's suppression when no suppression active!\n"); // we are unsuppressing after activating, so update focus-related commands - // we need this to update commands in the case where an element is focused. - if (!mSuppressFocus && mCurrentElement) + // we need this to update command, including the case where there is no element + // because nsPresShell::UnsuppressPainting may have just now unsuppressed + // focus on the currently focused window + if (!mSuppressFocus) UpdateCommands(NS_LITERAL_STRING("focus")); return NS_OK;