Bug 454235 - IME events not fired when clicking on text input box, adds IsOffScreenBrowser property to DocShell r=smaug sr=bz

This commit is contained in:
Brad Lassey
2008-09-19 12:57:56 -04:00
parent 0de4fed5c1
commit 0fb8f35a39
6 changed files with 100 additions and 3 deletions

View File

@@ -299,6 +299,7 @@ nsDocShell::nsDocShell():
mIsBeingDestroyed(PR_FALSE),
mIsExecutingOnLoadHandler(PR_FALSE),
mIsPrintingOrPP(PR_FALSE),
mIsOffScreenBrowser(PR_FALSE),
mSavingOldViewer(PR_FALSE),
mAppType(nsIDocShell::APP_TYPE_UNKNOWN),
mChildOffset(0),
@@ -3928,7 +3929,8 @@ nsDocShell::GetVisibility(PRBool * aVisibility)
}
// otherwise, we must walk up the document and view trees checking
// for a hidden view.
// for a hidden view, unless we're an off screen browser, which
// would make this test meaningless.
nsCOMPtr<nsIDocShellTreeItem> treeItem = this;
nsCOMPtr<nsIDocShellTreeItem> parentItem;
@@ -3953,7 +3955,9 @@ nsDocShell::GetVisibility(PRBool * aVisibility)
NS_ASSERTION(shellContent, "subshell not in the map");
nsIFrame* frame = pPresShell->GetPrimaryFrameFor(shellContent);
if (frame && !frame->AreAncestorViewsVisible()) {
PRBool isDocShellOffScreen = PR_FALSE;
docShell->GetIsOffScreenBrowser(&isDocShellOffScreen);
if (frame && !frame->AreAncestorViewsVisible() && !isDocShellOffScreen) {
*aVisibility = PR_FALSE;
return NS_OK;
}
@@ -3974,6 +3978,20 @@ nsDocShell::GetVisibility(PRBool * aVisibility)
return treeOwnerAsWin->GetVisibility(aVisibility);
}
NS_IMETHODIMP
nsDocShell::SetIsOffScreenBrowser(PRBool aIsOffScreen)
{
mIsOffScreenBrowser = aIsOffScreen;
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::GetIsOffScreenBrowser(PRBool *aIsOffScreen)
{
*aIsOffScreen = mIsOffScreenBrowser;
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::SetVisibility(PRBool aVisibility)
{