diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 1f5f92152acb..f5d61ba7ae95 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -834,7 +834,6 @@ public: nsIDOMEvent* aEvent, nsEventStatus* aStatus); NS_IMETHOD ResizeReflow(nsIView *aView, nscoord aWidth, nscoord aHeight); - NS_IMETHOD_(PRBool) IsVisible(); NS_IMETHOD_(PRBool) ShouldIgnoreInvalidation(); NS_IMETHOD_(void) WillPaint(PRBool aWillSendDidPaint); NS_IMETHOD_(void) DidPaint(); @@ -7181,18 +7180,6 @@ PresShell::ResizeReflow(nsIView *aView, nscoord aWidth, nscoord aHeight) return ResizeReflow(aWidth, aHeight); } -NS_IMETHODIMP_(PRBool) -PresShell::IsVisible() -{ - nsCOMPtr container = mPresContext->GetContainer(); - nsCOMPtr bw = do_QueryInterface(container); - if (!bw) - return PR_FALSE; - PRBool res = PR_TRUE; - bw->GetVisibility(&res); - return res; -} - NS_IMETHODIMP_(PRBool) PresShell::ShouldIgnoreInvalidation() { diff --git a/view/public/nsIViewObserver.h b/view/public/nsIViewObserver.h index 706768cf552e..0d944adac69e 100644 --- a/view/public/nsIViewObserver.h +++ b/view/public/nsIViewObserver.h @@ -47,8 +47,8 @@ class nsIRenderingContext; class nsGUIEvent; #define NS_IVIEWOBSERVER_IID \ - { 0x6af699da, 0x8bfe, 0x43c9, \ - { 0xae, 0xc1, 0x76, 0x1b, 0x03, 0x62, 0x8d, 0x64 } } + { 0x4d467c73, 0xb6a9, 0x462a, \ + { 0x90, 0x25, 0x80, 0xd9, 0x42, 0xbc, 0xcc, 0xb5 } } class nsIViewObserver : public nsISupports { @@ -107,12 +107,6 @@ public: */ NS_IMETHOD ResizeReflow(nsIView * aView, nscoord aWidth, nscoord aHeight) = 0; - /** - * Hack to find out if the view observer is itself visible, in lieu - * of having the view trees linked. - */ - NS_IMETHOD_(PRBool) IsVisible() = 0; - /** * Returns true if the view observer wants to drop all invalidation right now * because painting is suppressed. It will invalidate everything when it diff --git a/view/src/nsViewManager.cpp b/view/src/nsViewManager.cpp index 84660fb4c243..ad40891d7bb2 100644 --- a/view/src/nsViewManager.cpp +++ b/view/src/nsViewManager.cpp @@ -100,18 +100,6 @@ public: //-------------- End Invalidate Event Definition --------------------------- -static PRBool IsViewVisible(nsView *aView) -{ - if (!aView->IsEffectivelyVisible()) - return PR_FALSE; - - // Find out if the root view is visible by asking the view observer - // (this won't be needed anymore if we link view trees across chrome / - // content boundaries in DocumentViewerImpl::MakeWindow). - nsIViewObserver* vo = aView->GetViewManager()->GetViewObserver(); - return vo && vo->IsVisible(); -} - void nsViewManager::PostInvalidateEvent() { @@ -324,7 +312,7 @@ void nsViewManager::DoSetWindowDimensions(nscoord aWidth, nscoord aHeight) NS_IMETHODIMP nsViewManager::SetWindowDimensions(nscoord aWidth, nscoord aHeight) { if (mRootView) { - if (IsViewVisible(mRootView)) { + if (mRootView->IsEffectivelyVisible()) { mDelayedResize.SizeTo(NSCOORD_NONE, NSCOORD_NONE); DoSetWindowDimensions(aWidth, aHeight); } else { @@ -879,7 +867,7 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, ? vm->mRootView->GetParent()->GetViewManager() : nsnull) { if (vm->mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) && - IsViewVisible(vm->mRootView)) { + vm->mRootView->IsEffectivelyVisible()) { vm->FlushDelayedResize(PR_TRUE); // Paint later. @@ -894,7 +882,7 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, } if (!didResize) { - //NS_ASSERTION(IsViewVisible(view), "painting an invisible view"); + //NS_ASSERTION(view->IsEffectivelyVisible(), "painting an invisible view"); // Notify view observers that we're about to paint. // Make sure to not send WillPaint notifications while scrolling.