diff -r 40f7e81126a2 content/base/src/nsGkAtomList.h --- a/content/base/src/nsGkAtomList.h Thu Jan 01 16:18:33 2009 -0800 +++ b/content/base/src/nsGkAtomList.h Thu Jan 01 21:42:11 2009 -0400 @@ -406,6 +406,7 @@ GK_ATOM(headers, "headers") GK_ATOM(headers, "headers") GK_ATOM(height, "height") GK_ATOM(hidden, "hidden") +GK_ATOM(hiddenfocus, "hiddenfocus") GK_ATOM(hidechrome, "hidechrome") GK_ATOM(highest, "highest") GK_ATOM(horizontal, "horizontal") diff -r 40f7e81126a2 docshell/base/nsDocShell.cpp --- a/docshell/base/nsDocShell.cpp Thu Jan 01 16:18:33 2009 -0800 +++ b/docshell/base/nsDocShell.cpp Thu Jan 01 21:42:11 2009 -0400 @@ -296,7 +296,6 @@ nsDocShell::nsDocShell(): mObserveErrorPages(PR_TRUE), mAllowAuth(PR_TRUE), mAllowKeywordFixup(PR_FALSE), - mIsOffScreenBrowser(PR_FALSE), mFiredUnloadEvent(PR_FALSE), mEODForCurrentDocument(PR_FALSE), mURIResultedInDocument(PR_FALSE), @@ -3954,8 +3953,7 @@ nsDocShell::GetVisibility(PRBool * aVisi return NS_OK; // otherwise, we must walk up the document and view trees checking - // for a hidden view, unless we're an off screen browser, which - // would make this test meaningless. + // for a hidden view. nsCOMPtr treeItem = this; nsCOMPtr parentItem; @@ -3979,9 +3977,7 @@ nsDocShell::GetVisibility(PRBool * aVisi NS_ASSERTION(shellContent, "subshell not in the map"); nsIFrame* frame = pPresShell->GetPrimaryFrameFor(shellContent); - PRBool isDocShellOffScreen = PR_FALSE; - docShell->GetIsOffScreenBrowser(&isDocShellOffScreen); - if (frame && !frame->AreAncestorViewsVisible() && !isDocShellOffScreen) + if (frame && !frame->AreAncestorViewsVisible()) return NS_OK; treeItem = parentItem; @@ -3997,20 +3993,6 @@ nsDocShell::GetVisibility(PRBool * aVisi // Check with the tree owner as well to give embedders a chance to // expose visibility as well. 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 diff -r 40f7e81126a2 docshell/base/nsDocShell.h --- a/docshell/base/nsDocShell.h Thu Jan 01 16:18:33 2009 -0800 +++ b/docshell/base/nsDocShell.h Thu Jan 01 21:42:12 2009 -0400 @@ -575,7 +575,6 @@ protected: PRPackedBool mObserveErrorPages; PRPackedBool mAllowAuth; PRPackedBool mAllowKeywordFixup; - PRPackedBool mIsOffScreenBrowser; // This boolean is set to true right before we fire pagehide and generally // unset when we embed a new content viewer. While it's true no navigation diff -r 40f7e81126a2 docshell/base/nsIDocShell.idl --- a/docshell/base/nsIDocShell.idl Thu Jan 01 16:18:33 2009 -0800 +++ b/docshell/base/nsIDocShell.idl Thu Jan 01 21:42:12 2009 -0400 @@ -68,7 +68,7 @@ interface nsISecureBrowserUI; interface nsISecureBrowserUI; interface nsIDOMStorage; -[scriptable, uuid(dc4daea1-b43d-406f-bd62-c2ee879192ad)] +[scriptable, uuid(cf974f45-d2f1-4bd5-aecd-568a1c4da454)] interface nsIDocShell : nsISupports { /** @@ -466,12 +466,5 @@ interface nsIDocShell : nsISupports * editor data in the open document's session history entry. */ [noscript, notxpcom] void DetachEditorFromWindow(); - - /** - * If true, this browser is not visible in the traditional sense, but - * is actively being rendered to the screen (ex. painted on a canvas) - * and should be treated accordingly. - **/ - attribute boolean isOffScreenBrowser; }; diff -r 40f7e81126a2 layout/generic/nsFrame.cpp --- a/layout/generic/nsFrame.cpp Thu Jan 01 16:18:33 2009 -0800 +++ b/layout/generic/nsFrame.cpp Thu Jan 01 21:42:12 2009 -0400 @@ -3621,6 +3621,20 @@ nsIFrame::AreAncestorViewsVisible() cons { for (nsIView* view = GetClosestView(); view; view = view->GetParent()) { if (view->GetVisibility() == nsViewVisibility_kHide) { + // if a hidden view is associated with a deck child with the hiddenfocus + // attribute set to true, then we treat the view as visible. + nsIFrame* frame = static_cast(view->GetClientData()); + if (frame) { + nsIFrame* parentframe = frame->GetParent(); + if (parentframe->GetType() == nsGkAtoms::deckFrame) { + nsIContent* content = frame->GetContent(); + if (content && content->AttrValueIs(kNameSpaceID_None, + nsGkAtoms::hiddenfocus, nsGkAtoms::_true, + eCaseMatters)) + continue; + } + } + return PR_FALSE; } }