mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 20:49:27 +00:00
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:
parent
9abcc83528
commit
e78f794d7c
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user