From 1e3c47198dee0b40472388e63382f06ff67cd0df Mon Sep 17 00:00:00 2001 From: "mats.palmgren@bredband.net" Date: Mon, 18 Jun 2007 17:49:49 -0700 Subject: [PATCH] Make nsFocusController::MoveFocus() return an error code when it fails. Patch by Daniel Bainton . b=381404 r=me sr=jst --- dom/src/base/nsFocusController.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dom/src/base/nsFocusController.cpp b/dom/src/base/nsFocusController.cpp index 442b7c37ad2a..d274082e6077 100644 --- a/dom/src/base/nsFocusController.cpp +++ b/dom/src/base/nsFocusController.cpp @@ -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 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); } /////