Fix (again) setting of focused window/element on focus controller. This ensures that we do the right thing when given either an element or a window to focus. Bug 89214, r=neil, sr=jag.

This commit is contained in:
bryner%netscape.com 2006-09-14 06:07:40 +00:00
Родитель 8f59c1542e
Коммит 5b55589ce4
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -675,9 +675,13 @@ function WindowFocusTimerCallback(element)
// set the element in command dispatcher so focus will restore properly
// when the window does become active
document.commandDispatcher.focusedWindow = window;
if (element instanceof Components.interfaces.nsIDOMElement)
if (element instanceof Components.interfaces.nsIDOMWindow) {
document.commandDispatcher.focusedWindow = element;
document.commandDispatcher.focusedElement = null;
} else if (element instanceof Components.interfaces.nsIDOMElement) {
document.commandDispatcher.focusedWindow = element.ownerDocument.defaultView;
document.commandDispatcher.focusedElement = element;
}
}
}