Bug 192454. Window is focused again if onclick='window.open' and href = '#foo'. r=bryner, sr=jst

This commit is contained in:
aaronl%netscape.com 2003-03-06 18:42:49 +00:00
Родитель 70e6b0b21f
Коммит 44f512c44b
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -4620,9 +4620,8 @@ void nsEventStateManager::FocusElementButNotDocument(nsIContent *aContent)
{
// Focus an element in the current document, but don't switch document/window focus!
if (gLastFocusedDocument == mDocument || !gLastFocusedContent) {
if (gLastFocusedDocument == mDocument) {
// If we're already focused in this document,
// or if there was no last focus
// use normal focus method
if (mCurrentFocus != aContent) {
if (aContent)
@ -4633,6 +4632,10 @@ void nsEventStateManager::FocusElementButNotDocument(nsIContent *aContent)
return;
}
if (!gLastFocusedContent) {
return;
}
// The last focus wasn't in this document, so we may be getting our position from the selection
// while the window focus is currently somewhere else such as the find dialog