зеркало из https://github.com/mozilla/gecko-dev.git
Bug 516076, pass a contextual window to focus controller methods, so that it retrieves the controller for the right window, r=neil,sr=smaug
This commit is contained in:
Родитель
f7679e8fd8
Коммит
dc9b8b8573
|
@ -55,7 +55,6 @@
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsIPrivateDOMEvent.h"
|
#include "nsIPrivateDOMEvent.h"
|
||||||
#include "nsIEventStateManager.h"
|
#include "nsIEventStateManager.h"
|
||||||
#include "nsIFocusController.h"
|
|
||||||
#include "nsContentList.h"
|
#include "nsContentList.h"
|
||||||
#include "nsIObserver.h"
|
#include "nsIObserver.h"
|
||||||
#include "nsIBaseWindow.h"
|
#include "nsIBaseWindow.h"
|
||||||
|
|
|
@ -4417,7 +4417,7 @@ nsEventStateManager::DoContentCommandEvent(nsContentCommandEvent* aEvent)
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIController> controller;
|
nsCOMPtr<nsIController> controller;
|
||||||
nsresult rv = fc->GetControllerForCommand(cmd, getter_AddRefs(controller));
|
nsresult rv = fc->GetControllerForCommand(window, cmd, getter_AddRefs(controller));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
// When GetControllerForCommand succeeded but there is no controller, the
|
// When GetControllerForCommand succeeded but there is no controller, the
|
||||||
|
|
|
@ -59,7 +59,6 @@ class nsIPresShell;
|
||||||
class nsIDocShell;
|
class nsIDocShell;
|
||||||
class nsIDocShellTreeNode;
|
class nsIDocShellTreeNode;
|
||||||
class nsIDocShellTreeItem;
|
class nsIDocShellTreeItem;
|
||||||
class nsIFocusController;
|
|
||||||
class imgIContainer;
|
class imgIContainer;
|
||||||
class nsDOMDataTransfer;
|
class nsDOMDataTransfer;
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ class nsIContent;
|
||||||
class nsPIDOMWindow;
|
class nsPIDOMWindow;
|
||||||
class nsPresContext;
|
class nsPresContext;
|
||||||
class nsIWidget;
|
class nsIWidget;
|
||||||
class nsIFocusController;
|
|
||||||
class nsTextStateManager;
|
class nsTextStateManager;
|
||||||
class nsISelection;
|
class nsISelection;
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,6 @@
|
||||||
#include "nsLayoutUtils.h"
|
#include "nsLayoutUtils.h"
|
||||||
#include "nsContentCreatorFunctions.h"
|
#include "nsContentCreatorFunctions.h"
|
||||||
#include "mozAutoDocUpdate.h"
|
#include "mozAutoDocUpdate.h"
|
||||||
#include "nsIFocusController.h"
|
|
||||||
|
|
||||||
class nsINodeInfo;
|
class nsINodeInfo;
|
||||||
class nsIDOMNodeList;
|
class nsIDOMNodeList;
|
||||||
|
|
|
@ -417,6 +417,8 @@ nsXBLPrototypeHandler::DispatchXBLCommand(nsPIDOMEventTarget* aTarget, nsIDOMEve
|
||||||
nsCOMPtr<nsPIWindowRoot> windowRoot(do_QueryInterface(aTarget));
|
nsCOMPtr<nsPIWindowRoot> windowRoot(do_QueryInterface(aTarget));
|
||||||
if (windowRoot) {
|
if (windowRoot) {
|
||||||
windowRoot->GetFocusController(getter_AddRefs(focusController));
|
windowRoot->GetFocusController(getter_AddRefs(focusController));
|
||||||
|
if (windowRoot)
|
||||||
|
privateWindow = do_QueryInterface(windowRoot->GetWindow());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
privateWindow = do_QueryInterface(aTarget);
|
privateWindow = do_QueryInterface(aTarget);
|
||||||
|
@ -446,7 +448,7 @@ nsXBLPrototypeHandler::DispatchXBLCommand(nsPIDOMEventTarget* aTarget, nsIDOMEve
|
||||||
|
|
||||||
NS_LossyConvertUTF16toASCII command(mHandlerText);
|
NS_LossyConvertUTF16toASCII command(mHandlerText);
|
||||||
if (focusController)
|
if (focusController)
|
||||||
focusController->GetControllerForCommand(command.get(), getter_AddRefs(controller));
|
focusController->GetControllerForCommand(privateWindow, command.get(), getter_AddRefs(controller));
|
||||||
else
|
else
|
||||||
controller = GetController(aTarget); // We're attached to the receiver possibly.
|
controller = GetController(aTarget); // We're attached to the receiver possibly.
|
||||||
|
|
||||||
|
|
|
@ -369,7 +369,8 @@ nsXBLWindowKeyHandler::WalkHandlers(nsIDOMKeyEvent* aKeyEvent, nsIAtom* aEventTy
|
||||||
nsCOMPtr<nsIFocusController> fc;
|
nsCOMPtr<nsIFocusController> fc;
|
||||||
root->GetFocusController(getter_AddRefs(fc));
|
root->GetFocusController(getter_AddRefs(fc));
|
||||||
if (fc) {
|
if (fc) {
|
||||||
fc->GetControllers(getter_AddRefs(controllers));
|
nsCOMPtr<nsPIDOMWindow> piWindow = do_QueryInterface(root->GetWindow());
|
||||||
|
fc->GetControllers(piWindow, getter_AddRefs(controllers));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -489,7 +489,7 @@ nsXULCommandDispatcher::GetControllers(nsIControllers** aResult)
|
||||||
nsIFocusController* fc = GetFocusController();
|
nsIFocusController* fc = GetFocusController();
|
||||||
NS_ENSURE_TRUE(fc, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(fc, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
return fc->GetControllers(aResult);
|
return fc->GetControllers(mDocument->GetWindow(), aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
@ -498,7 +498,7 @@ nsXULCommandDispatcher::GetControllerForCommand(const char *aCommand, nsIControl
|
||||||
nsIFocusController* fc = GetFocusController();
|
nsIFocusController* fc = GetFocusController();
|
||||||
NS_ENSURE_TRUE(fc, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(fc, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
return fc->GetControllerForCommand(aCommand, _retval);
|
return fc->GetControllerForCommand(mDocument->GetWindow(), aCommand, _retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
|
@ -10579,7 +10579,7 @@ nsDocShell::GetControllerForCommand(const char * inCommand,
|
||||||
if (window) {
|
if (window) {
|
||||||
nsIFocusController *focusController = window->GetRootFocusController();
|
nsIFocusController *focusController = window->GetRootFocusController();
|
||||||
if (focusController)
|
if (focusController)
|
||||||
rv = focusController->GetControllerForCommand (inCommand, outController);
|
rv = focusController->GetControllerForCommand (window, inCommand, outController);
|
||||||
} // if window
|
} // if window
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
|
|
@ -78,6 +78,22 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsFocusController)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mPopupNode)
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mPopupNode)
|
||||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||||
|
|
||||||
|
static nsIContent*
|
||||||
|
GetRootFocusedContentAndWindow(nsPIDOMWindow* aContextWindow,
|
||||||
|
nsPIDOMWindow** aWindow)
|
||||||
|
{
|
||||||
|
*aWindow = nsnull;
|
||||||
|
|
||||||
|
if (aContextWindow) {
|
||||||
|
nsCOMPtr<nsPIDOMWindow> rootWindow = aContextWindow->GetPrivateRoot();
|
||||||
|
if (rootWindow) {
|
||||||
|
return nsFocusManager::GetFocusedDescendant(rootWindow, PR_TRUE, aWindow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nsnull;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsFocusController::Create(nsIFocusController** aResult)
|
nsFocusController::Create(nsIFocusController** aResult)
|
||||||
{
|
{
|
||||||
|
@ -91,72 +107,49 @@ nsFocusController::Create(nsIFocusController** aResult)
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsFocusController::GetControllers(nsIControllers** aResult)
|
nsFocusController::GetControllers(nsPIDOMWindow* aContextWindow, nsIControllers** aResult)
|
||||||
{
|
{
|
||||||
|
*aResult = nsnull;
|
||||||
|
|
||||||
// XXX: we should fix this so there's a generic interface that
|
// XXX: we should fix this so there's a generic interface that
|
||||||
// describes controllers, so this code would have no special
|
// describes controllers, so this code would have no special
|
||||||
// knowledge of what object might have controllers.
|
// knowledge of what object might have controllers.
|
||||||
nsCOMPtr<nsIDOMElement> focusedElement;
|
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
|
||||||
if (!fm) {
|
|
||||||
*aResult = nsnull;
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
fm->GetFocusedElement(getter_AddRefs(focusedElement));
|
nsCOMPtr<nsPIDOMWindow> focusedWindow;
|
||||||
if (focusedElement) {
|
nsIContent* focusedContent =
|
||||||
|
GetRootFocusedContentAndWindow(aContextWindow, getter_AddRefs(focusedWindow));
|
||||||
|
if (focusedContent) {
|
||||||
#ifdef MOZ_XUL
|
#ifdef MOZ_XUL
|
||||||
nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(focusedElement));
|
nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(focusedContent));
|
||||||
if (xulElement)
|
if (xulElement)
|
||||||
return xulElement->GetControllers(aResult);
|
return xulElement->GetControllers(aResult);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMNSHTMLTextAreaElement> htmlTextArea =
|
nsCOMPtr<nsIDOMNSHTMLTextAreaElement> htmlTextArea =
|
||||||
do_QueryInterface(focusedElement);
|
do_QueryInterface(focusedContent);
|
||||||
if (htmlTextArea)
|
if (htmlTextArea)
|
||||||
return htmlTextArea->GetControllers(aResult);
|
return htmlTextArea->GetControllers(aResult);
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMNSHTMLInputElement> htmlInputElement =
|
nsCOMPtr<nsIDOMNSHTMLInputElement> htmlInputElement =
|
||||||
do_QueryInterface(focusedElement);
|
do_QueryInterface(focusedContent);
|
||||||
if (htmlInputElement)
|
if (htmlInputElement)
|
||||||
return htmlInputElement->GetControllers(aResult);
|
return htmlInputElement->GetControllers(aResult);
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> content = do_QueryInterface(focusedElement);
|
if (focusedContent->IsEditable() && focusedWindow)
|
||||||
if (content && content->IsEditable()) {
|
return focusedWindow->GetControllers(aResult);
|
||||||
// Move up to the window.
|
|
||||||
nsCOMPtr<nsIDOMDocument> domDoc;
|
|
||||||
focusedElement->GetOwnerDocument(getter_AddRefs(domDoc));
|
|
||||||
nsCOMPtr<nsIDOMWindowInternal> domWindow =
|
|
||||||
do_QueryInterface(GetWindowFromDocument(domDoc));
|
|
||||||
if (domWindow)
|
|
||||||
return domWindow->GetControllers(aResult);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nsCOMPtr<nsIDOMWindow> focusedWindow;
|
|
||||||
fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
|
|
||||||
nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(focusedWindow);
|
nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(focusedWindow);
|
||||||
if (domWindow)
|
if (domWindow)
|
||||||
return domWindow->GetControllers(aResult);
|
return domWindow->GetControllers(aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
*aResult = nsnull;
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nsPIDOMWindow *
|
|
||||||
nsFocusController::GetWindowFromDocument(nsIDOMDocument* aDocument)
|
|
||||||
{
|
|
||||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(aDocument);
|
|
||||||
if (!doc)
|
|
||||||
return nsnull;
|
|
||||||
|
|
||||||
return doc->GetWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsFocusController::GetControllerForCommand(const char * aCommand,
|
nsFocusController::GetControllerForCommand(nsPIDOMWindow* aContextWindow,
|
||||||
|
const char * aCommand,
|
||||||
nsIController** _retval)
|
nsIController** _retval)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(_retval);
|
NS_ENSURE_ARG_POINTER(_retval);
|
||||||
|
@ -165,7 +158,7 @@ nsFocusController::GetControllerForCommand(const char * aCommand,
|
||||||
nsCOMPtr<nsIControllers> controllers;
|
nsCOMPtr<nsIControllers> controllers;
|
||||||
nsCOMPtr<nsIController> controller;
|
nsCOMPtr<nsIController> controller;
|
||||||
|
|
||||||
GetControllers(getter_AddRefs(controllers));
|
GetControllers(aContextWindow, getter_AddRefs(controllers));
|
||||||
if(controllers) {
|
if(controllers) {
|
||||||
controllers->GetControllerForCommand(aCommand, getter_AddRefs(controller));
|
controllers->GetControllerForCommand(aCommand, getter_AddRefs(controller));
|
||||||
if(controller) {
|
if(controller) {
|
||||||
|
@ -174,14 +167,8 @@ nsFocusController::GetControllerForCommand(const char * aCommand,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMElement> focusedElement;
|
nsCOMPtr<nsPIDOMWindow> focusedWindow;
|
||||||
nsCOMPtr<nsIDOMWindow> focusedWindow;
|
GetRootFocusedContentAndWindow(aContextWindow, getter_AddRefs(focusedWindow));
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
|
||||||
if (fm) {
|
|
||||||
fm->GetFocusedElement(getter_AddRefs(focusedElement));
|
|
||||||
fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
|
|
||||||
}
|
|
||||||
|
|
||||||
while (focusedWindow) {
|
while (focusedWindow) {
|
||||||
nsCOMPtr<nsIDOMWindowInternal> domWindow(do_QueryInterface(focusedWindow));
|
nsCOMPtr<nsIDOMWindowInternal> domWindow(do_QueryInterface(focusedWindow));
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,6 @@
|
||||||
#include "nsWeakReference.h"
|
#include "nsWeakReference.h"
|
||||||
#include "nsCycleCollectionParticipant.h"
|
#include "nsCycleCollectionParticipant.h"
|
||||||
|
|
||||||
class nsIDOMElement;
|
|
||||||
class nsIDOMWindow;
|
|
||||||
class nsPIDOMWindow;
|
class nsPIDOMWindow;
|
||||||
class nsIController;
|
class nsIController;
|
||||||
class nsIControllers;
|
class nsIControllers;
|
||||||
|
@ -67,15 +65,14 @@ public:
|
||||||
NS_IMETHOD GetPopupNode(nsIDOMNode** aNode);
|
NS_IMETHOD GetPopupNode(nsIDOMNode** aNode);
|
||||||
NS_IMETHOD SetPopupNode(nsIDOMNode* aNode);
|
NS_IMETHOD SetPopupNode(nsIDOMNode* aNode);
|
||||||
|
|
||||||
NS_IMETHOD GetControllerForCommand(const char *aCommand, nsIController** aResult);
|
NS_IMETHOD GetControllerForCommand(nsPIDOMWindow* aContextWindow,
|
||||||
NS_IMETHOD GetControllers(nsIControllers** aResult);
|
const char *aCommand,
|
||||||
|
nsIController** aResult);
|
||||||
|
NS_IMETHOD GetControllers(nsPIDOMWindow* aContextWindow, nsIControllers** aResult);
|
||||||
|
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFocusController,
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFocusController,
|
||||||
nsIFocusController)
|
nsIFocusController)
|
||||||
|
|
||||||
public:
|
|
||||||
static nsPIDOMWindow *GetWindowFromDocument(nsIDOMDocument* aElement);
|
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
protected:
|
protected:
|
||||||
nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER]
|
nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER]
|
||||||
|
|
|
@ -900,7 +900,7 @@ nsFocusManager::WindowHidden(nsIDOMWindow* aWindow)
|
||||||
// ensures that the focused window isn't in a chain of frames that doesn't
|
// ensures that the focused window isn't in a chain of frames that doesn't
|
||||||
// exist any more.
|
// exist any more.
|
||||||
if (window != mFocusedWindow) {
|
if (window != mFocusedWindow) {
|
||||||
nsCOMPtr<nsIWebNavigation> webnav(do_GetInterface(window));
|
nsCOMPtr<nsIWebNavigation> webnav(do_GetInterface(mFocusedWindow));
|
||||||
nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(webnav);
|
nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(webnav);
|
||||||
if (dsti) {
|
if (dsti) {
|
||||||
nsCOMPtr<nsIDocShellTreeItem> parentDsti;
|
nsCOMPtr<nsIDocShellTreeItem> parentDsti;
|
||||||
|
|
|
@ -45,14 +45,15 @@
|
||||||
#include "nsISupports.h"
|
#include "nsISupports.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
|
class nsPIDOMWindow;
|
||||||
class nsIDOMNode;
|
class nsIDOMNode;
|
||||||
class nsIController;
|
class nsIController;
|
||||||
class nsIControllers;
|
class nsIControllers;
|
||||||
|
|
||||||
// 2879DB1C-47AA-46C4-B184-2590CC39F262
|
// 6D733829-8AE4-43BD-BEEE-35420FE3E932
|
||||||
#define NS_IFOCUSCONTROLLER_IID \
|
#define NS_IFOCUSCONTROLLER_IID \
|
||||||
{ 0x2879db1c, 0x47aa, 0x46c4, \
|
{ 0x6d733829, 0x8ae4, 0x43bd, \
|
||||||
{ 0xb1, 0x84, 0x25, 0x90, 0xcc, 0x39, 0xf2, 0x62 } }
|
{ 0xbe, 0xee, 0x35, 0x42, 0x0f, 0xe3, 0xe9, 0x32 } }
|
||||||
|
|
||||||
class nsIFocusController : public nsISupports {
|
class nsIFocusController : public nsISupports {
|
||||||
public:
|
public:
|
||||||
|
@ -61,8 +62,10 @@ public:
|
||||||
NS_IMETHOD GetPopupNode(nsIDOMNode** aNode)=0;
|
NS_IMETHOD GetPopupNode(nsIDOMNode** aNode)=0;
|
||||||
NS_IMETHOD SetPopupNode(nsIDOMNode* aNode)=0;
|
NS_IMETHOD SetPopupNode(nsIDOMNode* aNode)=0;
|
||||||
|
|
||||||
NS_IMETHOD GetControllerForCommand(const char * aCommand, nsIController** aResult)=0;
|
NS_IMETHOD GetControllerForCommand(nsPIDOMWindow* aContextWindow,
|
||||||
NS_IMETHOD GetControllers(nsIControllers** aResult)=0;
|
const char * aCommand,
|
||||||
|
nsIController** aResult)=0;
|
||||||
|
NS_IMETHOD GetControllers(nsPIDOMWindow* aContextWindow, nsIControllers** aResult)=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIFocusController, NS_IFOCUSCONTROLLER_IID)
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsIFocusController, NS_IFOCUSCONTROLLER_IID)
|
||||||
|
|
|
@ -1143,10 +1143,22 @@ function switchWindowTest(otherWindow, framesetWindow)
|
||||||
is(exh, true, "activeWindow set to null");
|
is(exh, true, "activeWindow set to null");
|
||||||
is(fm.activeWindow, otherWindow, "window not changed when activeWindow set to null");
|
is(fm.activeWindow, otherWindow, "window not changed when activeWindow set to null");
|
||||||
|
|
||||||
var topwindow = getTopWindow(framesetWindow);
|
var topWindow = getTopWindow(framesetWindow);
|
||||||
|
|
||||||
|
ok(topWindow.document.commandDispatcher.getControllerForCommand("cmd_copy"),
|
||||||
|
"getControllerForCommand for focused window set");
|
||||||
|
ok(otherWindow.document.commandDispatcher.getControllerForCommand("cmd_copy"),
|
||||||
|
"getControllerForCommand for non-focused window set");
|
||||||
|
ok(topWindow.document.commandDispatcher.getControllerForCommand("cmd_copy") !=
|
||||||
|
otherWindow.document.commandDispatcher.getControllerForCommand("cmd_copy"),
|
||||||
|
"getControllerForCommand for two windows different");
|
||||||
|
ok(topWindow.document.commandDispatcher.getControllers() !=
|
||||||
|
otherWindow.document.commandDispatcher.getControllers(),
|
||||||
|
"getControllers for two windows different");
|
||||||
|
|
||||||
gOldExpectedWindow = otherWindow;
|
gOldExpectedWindow = otherWindow;
|
||||||
gNewExpectedWindow = framesetWindow.frames[1];
|
gNewExpectedWindow = framesetWindow.frames[1];
|
||||||
expectFocusShift(function () fm.activeWindow = topwindow,
|
expectFocusShift(function () fm.activeWindow = topWindow,
|
||||||
gNewExpectedWindow, getById("f4"), true, "switch to frame activeWindow");
|
gNewExpectedWindow, getById("f4"), true, "switch to frame activeWindow");
|
||||||
|
|
||||||
fm.clearFocus(otherWindow);
|
fm.clearFocus(otherWindow);
|
||||||
|
|
|
@ -347,6 +347,6 @@ nsCommandManager::GetControllerForCommand(const char *aCommand,
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
// no target window; send command to focus controller
|
// no target window; send command to focus controller
|
||||||
return focusController->GetControllerForCommand(aCommand, outController);
|
return focusController->GetControllerForCommand(window, aCommand, outController);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@
|
||||||
#include "nsIEventStateManager.h"
|
#include "nsIEventStateManager.h"
|
||||||
#include "nsIDocument.h"
|
#include "nsIDocument.h"
|
||||||
#include "nsIDOMDocument.h"
|
#include "nsIDOMDocument.h"
|
||||||
#include "nsIFocusController.h"
|
|
||||||
#include "nsISelectionController.h"
|
#include "nsISelectionController.h"
|
||||||
#include "nsISelection.h"
|
#include "nsISelection.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
|
|
|
@ -53,7 +53,6 @@
|
||||||
#include "nsMenuPopupFrame.h"
|
#include "nsMenuPopupFrame.h"
|
||||||
#include "nsGUIEvent.h"
|
#include "nsGUIEvent.h"
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsIFocusController.h"
|
|
||||||
#include "nsIDOMWindowInternal.h"
|
#include "nsIDOMWindowInternal.h"
|
||||||
#include "nsIDOMDocument.h"
|
#include "nsIDOMDocument.h"
|
||||||
#include "nsPIDOMWindow.h"
|
#include "nsPIDOMWindow.h"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче