Bug 592131. Don't propagate invalidations across document boundaries where the child document's docshell is inactive (e.g., a hidden tab). r=tnikkel,a=blocking
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 31 Aug 2010 17:02:08 +1200
changeset 51761 1b43ce0bda4fae9292f63c253af44f3794d62604
parent 51760 6476d13bec4943b81dfbfde2d5e28931dea4f08d
child 51763 f6b08f0179e3281ed4cd5cb7a043905e35fc3d30
child 54067 b9f973282e1f3a01b54580a614ac78148f7e4c62
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel, blocking
bugs592131
milestone2.0b5pre
first release with
nightly linux32
1b43ce0bda4f / 4.0b5pre / 20100831030734 / files
nightly linux64
1b43ce0bda4f / 4.0b5pre / 20100831030749 / files
nightly mac
1b43ce0bda4f / 4.0b5pre / 20100831030519 / files
nightly win32
1b43ce0bda4f / 4.0b5pre / 20100831040721 / files
nightly win64
1b43ce0bda4f / 4.0b5pre / 20100831011134 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 592131. Don't propagate invalidations across document boundaries where the child document's docshell is inactive (e.g., a hidden tab). r=tnikkel,a=blocking
layout/base/nsPresShell.cpp
layout/generic/nsViewportFrame.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -7184,17 +7184,17 @@ PresShell::IsVisible()
   PRBool res = PR_TRUE;
   bw->GetVisibility(&res);
   return res;
 }
 
 NS_IMETHODIMP_(PRBool)
 PresShell::ShouldIgnoreInvalidation()
 {
-  return mPaintingSuppressed;
+  return mPaintingSuppressed || !mIsActive;
 }
 
 NS_IMETHODIMP_(void)
 PresShell::WillPaint(PRBool aWillSendDidPaint)
 {
   // Don't bother doing anything if some viewmanager in our tree is
   // painting while we still have painting suppressed.
   if (mPaintingSuppressed) {
--- a/layout/generic/nsViewportFrame.cpp
+++ b/layout/generic/nsViewportFrame.cpp
@@ -356,29 +356,32 @@ ViewportFrame::IsContainingBlock() const
 }
 
 void
 ViewportFrame::InvalidateInternal(const nsRect& aDamageRect,
                                   nscoord aX, nscoord aY, nsIFrame* aForChild,
                                   PRUint32 aFlags)
 {
   nsRect r = aDamageRect + nsPoint(aX, aY);
-  PresContext()->NotifyInvalidation(r, aFlags);
+  nsPresContext* presContext = PresContext();
+  presContext->NotifyInvalidation(r, aFlags);
 
   if ((mState & NS_FRAME_HAS_CONTAINER_LAYER) &&
       !(aFlags & INVALIDATE_NO_THEBES_LAYERS)) {
     FrameLayerBuilder::InvalidateThebesLayerContents(this, r);
     // Don't need to invalidate any more Thebes layers
     aFlags |= INVALIDATE_NO_THEBES_LAYERS;
   }
 
   nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrame(this);
   if (parent) {
+    if (!presContext->PresShell()->IsActive())
+      return;
     nsPoint pt = -parent->GetOffsetToCrossDoc(this);
-    PRInt32 ourAPD = PresContext()->AppUnitsPerDevPixel();
+    PRInt32 ourAPD = presContext->AppUnitsPerDevPixel();
     PRInt32 parentAPD = parent->PresContext()->AppUnitsPerDevPixel();
     r = r.ConvertAppUnitsRoundOut(ourAPD, parentAPD);
     parent->InvalidateInternal(r, pt.x, pt.y, this,
                                aFlags | INVALIDATE_CROSS_DOC);
     return;
   }
   InvalidateRoot(r, aFlags);
 }