Bug 594267. Get rid of hack to determine if a document is visible now that chrome and content view managers are linked. r=roc a=roc

This commit is contained in:
Timothy Nikkel 2010-09-11 13:24:50 -05:00
Родитель debffe8d9a
Коммит 447ae6f4c6
3 изменённых файлов: 5 добавлений и 36 удалений

Просмотреть файл

@ -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<nsISupports> container = mPresContext->GetContainer();
nsCOMPtr<nsIBaseWindow> bw = do_QueryInterface(container);
if (!bw)
return PR_FALSE;
PRBool res = PR_TRUE;
bw->GetVisibility(&res);
return res;
}
NS_IMETHODIMP_(PRBool)
PresShell::ShouldIgnoreInvalidation()
{

Просмотреть файл

@ -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

Просмотреть файл

@ -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.