mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Make nsFocusController::MoveFocus() return an error code when it fails. Patch by Daniel Bainton <daniel.bainton@gmail.com>. b=381404 r=me sr=jst
This commit is contained in:
parent
d07fb7189a
commit
1e3c47198d
@ -297,15 +297,14 @@ nsFocusController::MoveFocus(PRBool aForward, nsIDOMElement* aElt)
|
||||
}
|
||||
}
|
||||
|
||||
if (!doc)
|
||||
if (!doc) {
|
||||
// No way to obtain an event state manager. Give up.
|
||||
return NS_OK;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
// Obtain a presentation context
|
||||
nsIPresShell *shell = doc->GetPrimaryShell();
|
||||
if (!shell)
|
||||
return NS_OK;
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// Make sure frames have been constructed before shifting focus, bug 273092.
|
||||
shell->FlushPendingNotifications(Flush_Frames);
|
||||
@ -314,9 +313,7 @@ nsFocusController::MoveFocus(PRBool aForward, nsIDOMElement* aElt)
|
||||
nsCOMPtr<nsPresContext> presContext = shell->GetPresContext();
|
||||
|
||||
// Make this ESM shift the focus per our instructions.
|
||||
presContext->EventStateManager()->ShiftFocus(aForward, content);
|
||||
|
||||
return NS_OK;
|
||||
return presContext->EventStateManager()->ShiftFocus(aForward, content);
|
||||
}
|
||||
|
||||
/////
|
||||
|
Loading…
Reference in New Issue
Block a user