Bug 579323. Part 1.8: Rename InvalidateOverflowRect to InvalidateFrameSubtree. r=tnikkel
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 31 Aug 2010 12:49:12 +1200
changeset 51756 8f8d9eb61a5cbc7341126c503c16b9f3c47de5c0
parent 51755 b002a8eb529f574d4ab07790510a15e5071c8cd2
child 51757 24c941e03dac17a3ec238b930fa574d3f2bda28c
push idunknown
push userunknown
push dateunknown
reviewerstnikkel
bugs579323
milestone2.0b5pre
Bug 579323. Part 1.8: Rename InvalidateOverflowRect to InvalidateFrameSubtree. r=tnikkel
content/html/content/src/nsHTMLInputElement.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsFrameManager.cpp
layout/generic/nsCanvasFrame.cpp
layout/generic/nsContainerFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsIFrame.h
layout/generic/nsSubDocumentFrame.cpp
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableFrame.cpp
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowGroupFrame.cpp
--- a/content/html/content/src/nsHTMLInputElement.cpp
+++ b/content/html/content/src/nsHTMLInputElement.cpp
@@ -967,17 +967,17 @@ nsHTMLInputElement::SetIndeterminateInte
                                              PRBool aShouldInvalidate)
 {
   SET_BOOLBIT(mBitField, BF_INDETERMINATE, aValue);
 
   if (aShouldInvalidate) {
     // Repaint the frame
     nsIFrame* frame = GetPrimaryFrame();
     if (frame)
-      frame->InvalidateOverflowRect();
+      frame->InvalidateFrameSubtree();
   }
 
   // Notify the document so it can update :indeterminate pseudoclass rules
   nsIDocument* document = GetCurrentDoc();
   if (document) {
     mozAutoDocUpdate upd(document, UPDATE_CONTENT_STATE, PR_TRUE);
     document->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_INDETERMINATE);
   }
@@ -1614,17 +1614,17 @@ nsHTMLInputElement::SetCheckedInternal(P
   SET_BOOLBIT(mBitField, BF_CHECKED, aChecked);
 
   //
   // Notify the frame
   //
   if (mType == NS_FORM_INPUT_CHECKBOX || mType == NS_FORM_INPUT_RADIO) {
     nsIFrame* frame = GetPrimaryFrame();
     if (frame) {
-      frame->InvalidateOverflowRect();
+      frame->InvalidateFrameSubtree();
     }
   }
 
   // Notify the document that the CSS :checked pseudoclass for this element
   // has changed state.
   if (aNotify) {
     nsIDocument* document = GetCurrentDoc();
     if (document) {
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -7738,17 +7738,17 @@ InvalidateCanvasIfNeeded(nsIPresShell* p
   // XHTML or something), but chances are we want to.  Play it safe.
   // Invalidate the viewport.
 
   // Wrap this in a DEFERRED view update batch so we don't try to
   // flush out layout here
 
   nsIViewManager::UpdateViewBatch batch(presShell->GetViewManager());
   nsIFrame* rootFrame = presShell->GetRootFrame();
-  rootFrame->InvalidateOverflowRect();
+  rootFrame->InvalidateFrameSubtree();
   batch.EndUpdateViewBatch(NS_VMREFRESH_DEFERRED);
 }
 
 nsresult
 nsCSSFrameConstructor::StyleChangeReflow(nsIFrame* aFrame,
                                          nsChangeHint aHint)
 {
   // If the frame hasn't even received an initial reflow, then don't
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -495,17 +495,17 @@ nsFrameManager::RemoveFrame(nsIAtom*    
   mIsDestroyingFrames = PR_TRUE;
 
   // In case the reflow doesn't invalidate anything since it just leaves
   // a gap where the old frame was, we invalidate it here.  (This is
   // reasonably likely to happen when removing a last child in a way
   // that doesn't change the size of the parent.)
   // This has to sure to invalidate the entire overflow rect; this
   // is important in the presence of absolute positioning
-  aOldFrame->InvalidateOverflowRect();
+  aOldFrame->InvalidateFrameSubtree();
 
   NS_ASSERTION(!aOldFrame->GetPrevContinuation() ||
                // exception for nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames
                aOldFrame->GetType() == nsGkAtoms::textFrame,
                "Must remove first continuation.");
   NS_ASSERTION(!(aOldFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW &&
                  GetPlaceholderFrameFor(aOldFrame)),
                "Must call RemoveFrame on placeholder for out-of-flows.");
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -95,26 +95,26 @@ nsCanvasFrame::DestroyFrom(nsIFrame* aDe
   nsHTMLContainerFrame::DestroyFrom(aDestructRoot);
 }
 
 void
 nsCanvasFrame::ScrollPositionWillChange(nscoord aX, nscoord aY)
 {
   if (mDoPaintFocus) {
     mDoPaintFocus = PR_FALSE;
-    PresContext()->FrameManager()->GetRootFrame()->InvalidateOverflowRect();
+    PresContext()->FrameManager()->GetRootFrame()->InvalidateFrameSubtree();
   }
 }
 
 NS_IMETHODIMP
 nsCanvasFrame::SetHasFocus(PRBool aHasFocus)
 {
   if (mDoPaintFocus != aHasFocus) {
     mDoPaintFocus = aHasFocus;
-    PresContext()->FrameManager()->GetRootFrame()->InvalidateOverflowRect();
+    PresContext()->FrameManager()->GetRootFrame()->InvalidateFrameSubtree();
 
     if (!mAddedScrollPositionListener) {
       nsIScrollableFrame* sf =
         PresContext()->GetPresShell()->GetRootScrollFrameAsScrollable();
       if (sf) {
         sf->AddScrollPositionListener(this);
         mAddedScrollPositionListener = PR_TRUE;
       }
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -719,17 +719,17 @@ nsContainerFrame::ReflowChild(nsIFrame* 
   // Send the WillReflow() notification, and position the child frame
   // and its view if requested
   aKidFrame->WillReflow(aPresContext);
 
   if (NS_FRAME_NO_MOVE_FRAME != (aFlags & NS_FRAME_NO_MOVE_FRAME)) {
     if ((aFlags & NS_FRAME_INVALIDATE_ON_MOVE) &&
         !(aKidFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) &&
         aKidFrame->GetPosition() != nsPoint(aX, aY)) {
-      aKidFrame->InvalidateOverflowRect();
+      aKidFrame->InvalidateFrameSubtree();
     }
     aKidFrame->SetPosition(nsPoint(aX, aY));
   }
 
   if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
     PositionFrameView(aKidFrame);
   }
 
@@ -1125,17 +1125,17 @@ nsContainerFrame::DeleteNextInFlowChild(
     }
     for (PRInt32 i = frames.Length() - 1; i >= 0; --i) {
       nsIFrame* delFrame = frames.ElementAt(i);
       static_cast<nsContainerFrame*>(delFrame->GetParent())
         ->DeleteNextInFlowChild(aPresContext, delFrame, aDeletingEmptyFrames);
     }
   }
 
-  aNextInFlow->InvalidateOverflowRect();
+  aNextInFlow->InvalidateFrameSubtree();
 
   // Take the next-in-flow out of the parent's child list
 #ifdef DEBUG
   nsresult rv =
 #endif
     StealFrame(aPresContext, aNextInFlow);
   NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame failure");
 
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3749,17 +3749,17 @@ NS_DECLARE_FRAME_PROPERTY(LayerActivityP
 void
 LayerActivityTracker::NotifyExpired(LayerActivity* aObject)
 {
   RemoveObject(aObject);
 
   nsIFrame* f = aObject->mFrame;
   aObject->mFrame = nsnull;
   f->Properties().Delete(LayerActivityProperty());
-  f->InvalidateOverflowRect();
+  f->InvalidateFrameSubtree();
 }
 
 void
 nsIFrame::MarkLayersActive()
 {
   FrameProperties properties = Properties();
   LayerActivity* layerActivity =
     static_cast<LayerActivity*>(properties.Get(LayerActivityProperty()));
@@ -3955,20 +3955,26 @@ nsIFrame::InvalidateRectDifference(const
 {
   nsRect sizeHStrip, sizeVStrip;
   nsLayoutUtils::GetRectDifferenceStrips(aR1, aR2, &sizeHStrip, &sizeVStrip);
   Invalidate(sizeVStrip);
   Invalidate(sizeHStrip);
 }
 
 void
+nsIFrame::InvalidateFrameSubtree()
+{
+  Invalidate(GetOverflowRectRelativeToSelf());
+  FrameLayerBuilder::InvalidateThebesLayersInSubtree(this);
+}
+
+void
 nsIFrame::InvalidateOverflowRect()
 {
   Invalidate(GetOverflowRectRelativeToSelf());
-  FrameLayerBuilder::InvalidateThebesLayersInSubtree(this);
 }
 
 NS_DECLARE_FRAME_PROPERTY(DeferInvalidatesProperty, nsIFrame::DestroyRegion)
 
 void
 nsIFrame::InvalidateRoot(const nsRect& aDamageRect, PRUint32 aFlags)
 {
   NS_ASSERTION(nsLayoutUtils::GetDisplayRootFrame(this) == this,
@@ -4635,17 +4641,17 @@ nsIFrame::SetSelected(PRBool aSelected, 
   for (nsIFrame* f = this; f; f = f->GetNextContinuation()) {
     if (aSelected) {
       AddStateBits(NS_FRAME_SELECTED_CONTENT);
     } else {
       RemoveStateBits(NS_FRAME_SELECTED_CONTENT);
     }
 
     // Repaint this frame subtree's entire area
-    InvalidateOverflowRect();
+    InvalidateFrameSubtree();
   }
 }
 
 NS_IMETHODIMP
 nsFrame::GetSelected(PRBool *aSelected) const
 {
   if (!aSelected )
     return NS_ERROR_NULL_POINTER;
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1258,17 +1258,17 @@ public:
     : nsExpirationTracker<nsGfxScrollFrameInner,4>(TIMEOUT_MS) {}
   ~ScrollFrameActivityTracker() {
     AgeAllGenerations();
   }
 
   virtual void NotifyExpired(nsGfxScrollFrameInner *aObject) {
     RemoveObject(aObject);
     aObject->mScrollingActive = PR_FALSE;
-    aObject->mOuter->InvalidateOverflowRect();
+    aObject->mOuter->InvalidateFrameSubtree();
   }
 };
 
 static ScrollFrameActivityTracker *gScrollFrameActivityTracker = nsnull;
 
 nsGfxScrollFrameInner::nsGfxScrollFrameInner(nsContainerFrame* aOuter,
                                              PRBool aIsRoot,
                                              PRBool aIsXUL)
@@ -2963,25 +2963,25 @@ static void LayoutAndInvalidate(nsBoxLay
   // to invalidate the scrollbar area here.
   // But we also need to invalidate the scrollbar itself in case it has
   // its own layer; we need to ensure that layer is updated.
   PRBool rectChanged = aBox->GetRect() != aRect;
   if (rectChanged) {
     if (aScrollbarIsBeingHidden) {
       aBox->GetParent()->Invalidate(aBox->GetOverflowRect() + aBox->GetPosition());
     } else {
-      aBox->InvalidateOverflowRect();
+      aBox->InvalidateFrameSubtree();
     }
   }
   nsBoxFrame::LayoutChildAt(aState, aBox, aRect);
   if (rectChanged) {
     if (aScrollbarIsBeingHidden) {
       aBox->GetParent()->Invalidate(aBox->GetOverflowRect() + aBox->GetPosition());
     } else {
-      aBox->InvalidateOverflowRect();
+      aBox->InvalidateFrameSubtree();
     }
   }
 }
 
 void
 nsGfxScrollFrameInner::AdjustScrollbarRectForResizer(
                          nsIFrame* aFrame, nsPresContext* aPresContext,
                          nsRect& aRect, PRBool aHasResizer, PRBool aVertical)
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -1967,18 +1967,26 @@ public:
   void InvalidateRectDifference(const nsRect& aR1, const nsRect& aR2);
 
   /**
    * Invalidate the entire frame subtree for this frame. Invalidates this
    * frame's overflow rect, and also ensures that all ThebesLayer children
    * of ContainerLayers associated with frames in this subtree are
    * completely invalidated.
    */
+  void InvalidateFrameSubtree();
+
+  /**
+   * Invalidate the overflow area for this frame. Invalidates this
+   * frame's overflow rect. Does not necessarily cause ThebesLayers for
+   * descendant frames to be repainted; only this frame can be relied on
+   * to be repainted.
+   */
   void InvalidateOverflowRect();
-  
+
   /**
    * Computes a rect that encompasses everything that might be painted by
    * this frame.  This includes this frame, all its descendent frames, this
    * frame's outline, and descentant frames' outline, but does not include
    * areas clipped out by the CSS "overflow" and "clip" properties.
    *
    * HasOverflowRect() (below) will return PR_TRUE when this overflow rect
    * has been explicitly set, even if it matches mRect.
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -817,22 +817,22 @@ nsSubDocumentFrame::EndSwapDocShells(nsI
 
   // Now make sure we reflow both frames, in case their contents
   // determine their size.
   // And repaint them, for good measure, in case there's nothing
   // interesting that happens during reflow.
   if (weakThis.IsAlive()) {
     PresContext()->PresShell()->
       FrameNeedsReflow(this, nsIPresShell::eTreeChange, NS_FRAME_IS_DIRTY);
-    InvalidateOverflowRect();
+    InvalidateFrameSubtree();
   }
   if (weakOther.IsAlive()) {
     other->PresContext()->PresShell()->
       FrameNeedsReflow(other, nsIPresShell::eTreeChange, NS_FRAME_IS_DIRTY);
-    other->InvalidateOverflowRect();
+    other->InvalidateFrameSubtree();
   }
 }
 
 nsIView*
 nsSubDocumentFrame::CreateViewAndWidget(nsContentType aContentType)
 {
   if (mInnerView) {
     // Nothing to do here
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -603,33 +603,33 @@ void nsTableCellFrame::VerticallyAlignCh
       // Align the middle of the child frame with the middle of the content area,
       kidYTop = (height - childHeight - bottomInset + topInset) / 2;
   }
   // if the content is larger than the cell height align from top
   kidYTop = NS_MAX(0, kidYTop);
 
   if (kidYTop != kidRect.y) {
     // Invalidate at the old position first
-    firstKid->InvalidateOverflowRect();
+    firstKid->InvalidateFrameSubtree();
   }
 
   firstKid->SetPosition(nsPoint(kidRect.x, kidYTop));
   nsHTMLReflowMetrics desiredSize;
   desiredSize.width = mRect.width;
   desiredSize.height = mRect.height;
   GetSelfOverflow(desiredSize.mOverflowArea);
   ConsiderChildOverflow(desiredSize.mOverflowArea, firstKid);
   FinishAndStoreOverflow(&desiredSize);
   if (kidYTop != kidRect.y) {
     // Make sure any child views are correctly positioned. We know the inner table
     // cell won't have a view
     nsContainerFrame::PositionChildViews(firstKid);
 
     // Invalidate new overflow rect
-    firstKid->InvalidateOverflowRect();
+    firstKid->InvalidateFrameSubtree();
   }
   if (HasView()) {
     nsContainerFrame::SyncFrameViewAfterReflow(PresContext(), this,
                                                GetView(),
                                                &desiredSize.mOverflowArea, 0);
   }
 }
 
@@ -921,17 +921,17 @@ NS_METHOD nsTableCellFrame::Reflow(nsPre
     // Don't pass OVERFLOW_INCOMPLETE through tables until they can actually handle it
     //XXX should paginate overflow as overflow, but not in this patch (bug 379349)
     NS_FRAME_SET_INCOMPLETE(aStatus);
     printf("Set table cell incomplete %p\n", static_cast<void*>(this));
   }
 
   // XXXbz is this invalidate actually needed, really?
   if (GetStateBits() & NS_FRAME_IS_DIRTY) {
-    InvalidateOverflowRect();
+    InvalidateFrameSubtree();
   }
 
 #ifdef NS_DEBUG
   DebugCheckChildSize(firstKid, kidSize, availSize);
 #endif
 
   // 0 dimensioned cells need to be treated specially in Standard/NavQuirks mode
   // see testcase "emptyCells.html"
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -2876,22 +2876,22 @@ nsTableFrame::ReflowChildren(nsTableRefl
         break;
       }
     }
     else { // it isn't being reflowed
       aReflowState.y += cellSpacingY;
       nsRect kidRect = kidFrame->GetRect();
       if (kidRect.y != aReflowState.y) {
         // invalidate the old position
-        kidFrame->InvalidateOverflowRect();
+        kidFrame->InvalidateFrameSubtree();
         kidRect.y = aReflowState.y;
         kidFrame->SetRect(kidRect);        // move to the new position
         RePositionViews(kidFrame);
         // invalidate the new position
-        kidFrame->InvalidateOverflowRect();
+        kidFrame->InvalidateFrameSubtree();
       }
       aReflowState.y += kidRect.height;
 
       // If our height is constrained then update the available height.
       if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height) {
         aReflowState.availSize.height -= cellSpacingY + kidRect.height;
       }
     }
@@ -3067,49 +3067,49 @@ nsTableFrame::DistributeHeightToRows(con
             nsTableFrame::RePositionViews(rowFrame);
 
             rgFrame->InvalidateRectDifference(oldRowRect, rowRect);
           }
         }
         else {
           if (amountUsed > 0 && yOriginRow != rowRect.y &&
               !(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
-            rowFrame->InvalidateOverflowRect();
+            rowFrame->InvalidateFrameSubtree();
             rowFrame->SetPosition(nsPoint(rowRect.x, yOriginRow));
             nsTableFrame::RePositionViews(rowFrame);
-            rowFrame->InvalidateOverflowRect();
+            rowFrame->InvalidateFrameSubtree();
           }
           yOriginRow += rowRect.height + cellSpacingY;
           yEndRG += rowRect.height + cellSpacingY;
         }
         rowFrame = rowFrame->GetNextRow();
       }
       if (amountUsed > 0) {
         if (rgRect.y != yOriginRG) {
-          rgFrame->InvalidateOverflowRect();
+          rgFrame->InvalidateFrameSubtree();
         }
 
         nsRect origRgRect = rgRect;
         nsRect origRgOverflowRect = rgFrame->GetOverflowRect();
 
         rgRect.y = yOriginRG;
         rgRect.height += amountUsedByRG;
 
         rgFrame->SetRect(rgRect);
 
         nsTableFrame::InvalidateFrame(rgFrame, origRgRect, origRgOverflowRect,
                                       PR_FALSE);
       }
     }
     else if (amountUsed > 0 && yOriginRG != rgRect.y) {
-      rgFrame->InvalidateOverflowRect();
+      rgFrame->InvalidateFrameSubtree();
       rgFrame->SetPosition(nsPoint(rgRect.x, yOriginRG));
       // Make sure child views are properly positioned
       nsTableFrame::RePositionViews(rgFrame);
-      rgFrame->InvalidateOverflowRect();
+      rgFrame->InvalidateFrameSubtree();
     }
     yOriginRG = yEndRG;
   }
 
   if (amountUsed >= aAmount) {
     ResizeCells(*this);
     return;
   }
@@ -3208,17 +3208,17 @@ nsTableFrame::DistributeHeightToRows(con
           }
           // give rows their additional space, except for the last row which
           // gets the remainder
           nscoord amountForRow = (rowFrame == lastEligibleRow)
                                  ? aAmount - amountUsed : NSToCoordRound(((float)(heightToDistribute)) * ratio);
           amountForRow = NS_MIN(amountForRow, aAmount - amountUsed);
 
           if (yOriginRow != rowRect.y) {
-            rowFrame->InvalidateOverflowRect();
+            rowFrame->InvalidateFrameSubtree();
           }
 
           // update the row height
           nsRect newRowRect(rowRect.x, yOriginRow, rowRect.width,
                             rowRect.height + amountForRow);
           rowFrame->SetRect(newRowRect);
 
           yOriginRow += newRowRect.height + cellSpacingY;
@@ -3230,45 +3230,45 @@ nsTableFrame::DistributeHeightToRows(con
           //rowFrame->DidResize();
           nsTableFrame::RePositionViews(rowFrame);
 
           nsTableFrame::InvalidateFrame(rowFrame, rowRect, rowOverflowRect,
                                         PR_FALSE);
         }
         else {
           if (amountUsed > 0 && yOriginRow != rowRect.y) {
-            rowFrame->InvalidateOverflowRect();
+            rowFrame->InvalidateFrameSubtree();
             rowFrame->SetPosition(nsPoint(rowRect.x, yOriginRow));
             nsTableFrame::RePositionViews(rowFrame);
-            rowFrame->InvalidateOverflowRect();
+            rowFrame->InvalidateFrameSubtree();
           }
           yOriginRow += rowRect.height + cellSpacingY;
           yEndRG += rowRect.height + cellSpacingY;
         }
         rowFrame = rowFrame->GetNextRow();
       }
       if (amountUsed > 0) {
         if (rgRect.y != yOriginRG) {
-          rgFrame->InvalidateOverflowRect();
+          rgFrame->InvalidateFrameSubtree();
         }
 
         rgFrame->SetRect(nsRect(rgRect.x, yOriginRG, rgRect.width,
                                 rgRect.height + amountUsedByRG));
 
         nsTableFrame::InvalidateFrame(rgFrame, rgRect, rgOverflowRect,
                                       PR_FALSE);
       }
       // Make sure child views are properly positioned
     }
     else if (amountUsed > 0 && yOriginRG != rgRect.y) {
-      rgFrame->InvalidateOverflowRect();
+      rgFrame->InvalidateFrameSubtree();
       rgFrame->SetPosition(nsPoint(rgRect.x, yOriginRG));
       // Make sure child views are properly positioned
       nsTableFrame::RePositionViews(rgFrame);
-      rgFrame->InvalidateOverflowRect();
+      rgFrame->InvalidateFrameSubtree();
     }
     yOriginRG = yEndRG;
   }
 
   ResizeCells(*this);
 }
 
 PRInt32 nsTableFrame::GetColumnWidth(PRInt32 aColIndex)
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -916,17 +916,17 @@ nsTableRowFrame::ReflowChildren(nsPresCo
         // allow the table to determine if/how the table needs to be rebalanced
         // If any of the cells are not complete, then we're not complete
         if (NS_FRAME_IS_NOT_COMPLETE(status)) {
           aStatus = NS_FRAME_NOT_COMPLETE;
         }
       }
       else {
         if (x != kidRect.x) {
-          kidFrame->InvalidateOverflowRect();
+          kidFrame->InvalidateFrameSubtree();
         }
         
         desiredSize.width = cellDesiredSize.width;
         desiredSize.height = cellDesiredSize.height;
         if (cellFrame->HasOverflowRect())
           desiredSize.mOverflowArea = cellFrame->GetOverflowRect();
         else
           desiredSize.mOverflowArea.SetRect(0, 0, cellDesiredSize.width,
@@ -973,22 +973,22 @@ nsTableRowFrame::ReflowChildren(nsPresCo
       nsTableFrame::InvalidateFrame(kidFrame, kidRect, kidOverflowRect,
                                     firstReflow);
       
       x += desiredSize.width;  
     }
     else {
       if (kidRect.x != x) {
         // Invalidate the old position
-        kidFrame->InvalidateOverflowRect();
+        kidFrame->InvalidateFrameSubtree();
         // move to the new position
         kidFrame->SetPosition(nsPoint(x, kidRect.y));
         nsTableFrame::RePositionViews(kidFrame);
         // invalidate the new position
-        kidFrame->InvalidateOverflowRect();
+        kidFrame->InvalidateFrameSubtree();
       }
       // we need to account for the cell's width even if it isn't reflowed
       x += kidRect.width;
 
       if (kidFrame->GetNextInFlow()) {
         aStatus = NS_FRAME_NOT_COMPLETE;
       }
     }
@@ -1147,17 +1147,17 @@ nsTableRowFrame::CollapseRowIfNecessary(
   if (!tableFrame)
       return 0;
   if (collapseRow) {
     tableFrame->SetNeedToCollapse(PR_TRUE);
   }
 
   if (aRowOffset != 0) {
     // We're moving, so invalidate our old position
-    InvalidateOverflowRect();
+    InvalidateFrameSubtree();
   }
   
   nsRect rowRect = GetRect();
   nsRect oldRect = rowRect;
   nsRect oldOverflowRect = GetOverflowRect();
   
   rowRect.y -= aRowOffset;
   rowRect.width  = aWidth;
@@ -1268,17 +1268,17 @@ nsTableRowFrame::CollapseRowIfNecessary(
           rowFrame = rowFrame->GetNextRow();
         }
 
         nsRect oldCellRect = cellFrame->GetRect();
         nsRect oldCellOverflowRect = cellFrame->GetOverflowRect();
 
         if (aRowOffset == 0 && cRect.TopLeft() != oldCellRect.TopLeft()) {
           // We're moving the cell.  Invalidate the old overflow area
-          cellFrame->InvalidateOverflowRect();
+          cellFrame->InvalidateFrameSubtree();
         }
         
         cellFrame->SetRect(cRect);
 
         // XXXbz This looks completely bogus in the cases when we didn't
         // collapse the cell!
         nsRect cellOverflow = nsRect(0, 0, cRect.width, cRect.height);
         cellFrame->FinishAndStoreOverflow(&cellOverflow, nsSize(cRect.width,
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -811,17 +811,17 @@ nsTableRowGroupFrame::CalculateRowHeight
     nsRect rowOverflowRect = rowFrame->GetOverflowRect();
 
     PRBool movedFrame = (rowBounds.y != yOrigin);  
     nscoord rowHeight = (rowInfo[rowIndex].height > 0) ? rowInfo[rowIndex].height : 0;
     
     if (movedFrame || (rowHeight != rowBounds.height)) {
       // Resize/move the row to its final size and position
       if (movedFrame) {
-        rowFrame->InvalidateOverflowRect();
+        rowFrame->InvalidateFrameSubtree();
       }
       
       rowFrame->SetRect(nsRect(rowBounds.x, yOrigin, rowBounds.width,
                                rowHeight));
 
       nsTableFrame::InvalidateFrame(rowFrame, rowBounds, rowOverflowRect,
                                     PR_FALSE);
     }
@@ -876,17 +876,17 @@ nsTableRowGroupFrame::CollapseRowGroupIf
     // add back the cellspacing between rowgroups
     groupRect.height += tableFrame->GetCellSpacingY();
   }
 
   groupRect.y -= aYTotalOffset;
   groupRect.width = aWidth;
 
   if (aYTotalOffset != 0) {
-    InvalidateOverflowRect();
+    InvalidateFrameSubtree();
   }
   
   SetRect(groupRect);
   overflowArea.UnionRect(nsRect(0, 0, groupRect.width, groupRect.height),
                          overflowArea);
   FinishAndStoreOverflow(&overflowArea, nsSize(groupRect.width,
                                               groupRect.height));
   nsTableFrame::RePositionViews(this);
@@ -901,20 +901,20 @@ void
 nsTableRowGroupFrame::SlideChild(nsRowGroupReflowState& aReflowState,
                                  nsIFrame*              aKidFrame)
 {
   // Move the frame if we need to
   nsPoint oldPosition = aKidFrame->GetPosition();
   nsPoint newPosition = oldPosition;
   newPosition.y = aReflowState.y;
   if (oldPosition.y != newPosition.y) {
-    aKidFrame->InvalidateOverflowRect();
+    aKidFrame->InvalidateFrameSubtree();
     aKidFrame->SetPosition(newPosition);
     nsTableFrame::RePositionViews(aKidFrame);
-    aKidFrame->InvalidateOverflowRect();
+    aKidFrame->InvalidateFrameSubtree();
   }
 }
 
 // Create a continuing frame, add it to the child list, and then push it
 // and the frames that follow
 void 
 nsTableRowGroupFrame::CreateContinuingRowFrame(nsPresContext& aPresContext,
                                                nsIFrame&      aRowFrame,