Bug 545581. Stop checking view visibility at content/chrome boundary. r=mats

--HG--
extra : rebase_source : 57383fcc5138b4b4ff27619adaaec33fba38a3a2
This commit is contained in:
Robert O'Callahan 2010-02-24 11:37:58 -08:00
parent 90767618c5
commit ae45815e53

View File

@ -3582,10 +3582,23 @@ NS_IMETHODIMP nsFrame::GetOffsetFromView(nsPoint& aOffset,
/* virtual */ PRBool
nsIFrame::AreAncestorViewsVisible() const
{
for (nsIView* view = GetClosestView(); view; view = view->GetParent()) {
if (view->GetVisibility() == nsViewVisibility_kHide) {
const nsIFrame* parent;
for (const nsIFrame* f = this; f; f = parent) {
nsIView* view = f->GetView();
if (view && view->GetVisibility() == nsViewVisibility_kHide) {
return PR_FALSE;
}
parent = f->GetParent();
if (!parent) {
parent = nsLayoutUtils::GetCrossDocParentFrame(f);
if (parent && parent->PresContext()->IsChrome() &&
!f->PresContext()->IsChrome()) {
// Don't look beyond chrome/content boundary ... if the chrome
// has hidden a content docshell, the content in the content
// docshell shouldn't be affected (e.g. it should remain focusable).
break;
}
}
}
return PR_TRUE;
}