Don't lose keyboard focus when going forward to a bfcached page. Bug 314362,

patch by Oliver Yeoh <oliver_yeoh@hotmail.com>, r=bryner, sr=jst
This commit is contained in:
bzbarsky%mit.edu 2006-09-20 01:29:47 +00:00
parent ce51ad8bb6
commit e9255f1aeb

View File

@ -7166,8 +7166,13 @@ nsGlobalWindow::RestoreWindowState(nsISupports *aState)
}
}
if (!didFocusContent && focusedWindow)
if (!didFocusContent && focusedWindow) {
// Clear the focus controller's memory of any focused element so that
// the element does not get inadvertently focused again.
fc->ResetElementFocus();
focusedWindow->Focus();
}
} else if (focusedWindow) {
// Just update the saved focus memory.
fc->SetFocusedWindow(focusedWindow);