diff --git a/content/xbl/src/nsXBLWindowKeyHandler.cpp b/content/xbl/src/nsXBLWindowKeyHandler.cpp index ff136617290..0f77ce4e5f9 100644 --- a/content/xbl/src/nsXBLWindowKeyHandler.cpp +++ b/content/xbl/src/nsXBLWindowKeyHandler.cpp @@ -16,7 +16,6 @@ #include "nsIDOMElement.h" #include "nsINativeKeyBindings.h" #include "nsIController.h" -#include "nsIControllers.h" #include "nsFocusManager.h" #include "nsPIWindowRoot.h" #include "nsIURI.h" @@ -287,13 +286,13 @@ GetEditorKeyBindings() static void DoCommandCallback(const char *aCommand, void *aData) { - nsIControllers *controllers = static_cast(aData); - if (!controllers) { + nsCOMPtr root = do_QueryInterface(static_cast(aData)); + if (!root) { return; } nsCOMPtr controller; - controllers->GetControllerForCommand(aCommand, getter_AddRefs(controller)); + root->GetControllerForCommand(aCommand, getter_AddRefs(controller)); if (!controller) { return; } @@ -353,13 +352,6 @@ nsXBLWindowKeyHandler::WalkHandlers(nsIDOMKeyEvent* aKeyEvent, nsIAtom* aEventTy // bindings? I.e., should we call WalkHandlersInternal() after this // block? if (isEditor && GetEditorKeyBindings()) { - // get the DOM window we're attached to - nsCOMPtr controllers; - nsCOMPtr root = do_QueryInterface(mTarget); - if (root) { - root->GetControllers(getter_AddRefs(controllers)); - } - WidgetKeyboardEvent* keyEvent = aKeyEvent->GetInternalNSEvent()->AsKeyboardEvent(); MOZ_ASSERT(keyEvent, @@ -369,17 +361,17 @@ nsXBLWindowKeyHandler::WalkHandlers(nsIDOMKeyEvent* aKeyEvent, nsIAtom* aEventTy case NS_KEY_PRESS: handled = sNativeEditorBindings->KeyPress(*keyEvent, DoCommandCallback, - controllers); + mTarget); break; case NS_KEY_UP: handled = sNativeEditorBindings->KeyUp(*keyEvent, DoCommandCallback, - controllers); + mTarget); break; case NS_KEY_DOWN: handled = sNativeEditorBindings->KeyDown(*keyEvent, DoCommandCallback, - controllers); + mTarget); break; default: MOZ_CRASH("Unknown key message");