Bug 44257 -- fix tabbing from URL bar to document. r=saari, sr=shaver.
This commit is contained in:
Родитель
7ed41a9893
Коммит
40d99f0540
|
@ -71,6 +71,7 @@
|
||||||
#include "nsIPrincipal.h"
|
#include "nsIPrincipal.h"
|
||||||
|
|
||||||
#include "nsPIDOMWindow.h"
|
#include "nsPIDOMWindow.h"
|
||||||
|
#include "nsIDOMDocument.h"
|
||||||
|
|
||||||
// For reporting errors with the console service.
|
// For reporting errors with the console service.
|
||||||
// These can go away if error reporting is propagated up past nsDocShell.
|
// These can go away if error reporting is propagated up past nsDocShell.
|
||||||
|
@ -1971,11 +1972,19 @@ NS_IMETHODIMP nsDocShell::GetMainWidget(nsIWidget** aMainWidget)
|
||||||
|
|
||||||
NS_IMETHODIMP nsDocShell::SetFocus()
|
NS_IMETHODIMP nsDocShell::SetFocus()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIWidget> mainWidget;
|
nsCOMPtr<nsIDOMDocument> domDoc;
|
||||||
GetMainWidget(getter_AddRefs(mainWidget));
|
mContentViewer->GetDOMDocument(getter_AddRefs(domDoc));
|
||||||
if(mainWidget)
|
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
|
||||||
mainWidget->SetFocus();
|
if (doc) {
|
||||||
return NS_OK;
|
nsCOMPtr<nsIScriptGlobalObject> sgo;
|
||||||
|
doc->GetScriptGlobalObject(getter_AddRefs(sgo));
|
||||||
|
if (sgo) {
|
||||||
|
nsCOMPtr<nsIDOMWindowInternal> domwin(do_QueryInterface(sgo));
|
||||||
|
if (domwin)
|
||||||
|
domwin->Focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsDocShell::FocusAvailable(nsIBaseWindow* aCurrentFocus,
|
NS_IMETHODIMP nsDocShell::FocusAvailable(nsIBaseWindow* aCurrentFocus,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче