зеркало из https://github.com/mozilla/gecko-dev.git
Bug 92210 - Window steals focus if you switch to another app during "Transferring data from...". r=saari, sr=hyatt.
This commit is contained in:
Родитель
3e9c57d306
Коммит
d1b47d9b27
|
@ -961,6 +961,31 @@ nsresult nsDocShell::FindTarget(const PRUnichar *aWindowTarget,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetEldestPresContext(nsIPresContext** aPresContext)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aPresContext);
|
||||
*aPresContext = nsnull;
|
||||
|
||||
nsCOMPtr<nsIContentViewer> viewer = mContentViewer;
|
||||
while (viewer) {
|
||||
nsCOMPtr<nsIContentViewer> prevViewer;
|
||||
viewer->GetPreviousViewer(getter_AddRefs(prevViewer));
|
||||
if (prevViewer)
|
||||
viewer = prevViewer;
|
||||
else {
|
||||
nsCOMPtr<nsIDocumentViewer> docv(do_QueryInterface(viewer));
|
||||
if (docv)
|
||||
rv = docv->GetPresContext(*aPresContext);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetPresContext(nsIPresContext ** aPresContext)
|
||||
{
|
||||
|
@ -999,6 +1024,24 @@ nsDocShell::GetPresShell(nsIPresShell ** aPresShell)
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetEldestPresShell(nsIPresShell** aPresShell)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aPresShell);
|
||||
*aPresShell = nsnull;
|
||||
|
||||
nsCOMPtr<nsIPresContext> presContext;
|
||||
(void) GetEldestPresContext(getter_AddRefs(presContext));
|
||||
|
||||
if (presContext) {
|
||||
rv = presContext->GetShell(aPresShell);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetContentViewer(nsIContentViewer ** aContentViewer)
|
||||
{
|
||||
|
|
|
@ -210,6 +210,7 @@ protected:
|
|||
nsIStreamListener ** aContentHandler, nsIContentViewer ** aViewer);
|
||||
NS_IMETHOD SetupNewViewer(nsIContentViewer * aNewViewer);
|
||||
|
||||
NS_IMETHOD GetEldestPresContext(nsIPresContext** aPresContext);
|
||||
NS_IMETHOD CreateFixupURI(const PRUnichar * aStringURI, nsIURI ** aURI);
|
||||
NS_IMETHOD GetCurrentDocumentOwner(nsISupports ** aOwner);
|
||||
virtual nsresult DoURILoad(nsIURI * aURI,
|
||||
|
|
|
@ -144,10 +144,16 @@ interface nsIDocShell : nsISupports
|
|||
[noscript] readonly attribute nsIPresContext presContext;
|
||||
|
||||
/**
|
||||
* Presentation context for the currently loaded document. This may be null.
|
||||
* Presentation shell for the currently loaded document. This may be null.
|
||||
*/
|
||||
[noscript] readonly attribute nsIPresShell presShell;
|
||||
|
||||
/**
|
||||
* Presentation shell for the oldest document, if this docshell is
|
||||
* currently transitioning between documents.
|
||||
*/
|
||||
[noscript] readonly attribute nsIPresShell eldestPresShell;
|
||||
|
||||
/**
|
||||
* Content Viewer that is currently loaded for this DocShell. This may
|
||||
* change as the underlying content changes.
|
||||
|
|
|
@ -1747,7 +1747,7 @@ NS_IMETHODIMP GlobalWindowImpl::Focus()
|
|||
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
if (mDocShell) {
|
||||
mDocShell->GetPresShell(getter_AddRefs(presShell));
|
||||
mDocShell->GetEldestPresShell(getter_AddRefs(presShell));
|
||||
}
|
||||
|
||||
nsresult result = NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче