Bug 492837. If a scrollframe's reflow is interrupted, don't clamp the scroll position to the new size. r=bzbarsky
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 12 Jun 2009 13:46:33 +1200
changeset 29108 af7c59f1634a3b40e95fbb11ba093e08b5a26c20
parent 29107 9eed09531a50c5b2db50be13b7de5fdda9ed0e5c
child 29109 4051ce823b55c37468e396c9a966e2a693c03114
push id7423
push userrocallahan@mozilla.com
push dateFri, 12 Jun 2009 02:16:07 +0000
treeherderautoland@b3c4e464fed7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs492837
milestone1.9.2a1pre
Bug 492837. If a scrollframe's reflow is interrupted, don't clamp the scroll position to the new size. r=bzbarsky
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2365,32 +2365,35 @@ nsGfxScrollFrameInner::FinishReflowForSc
   SetCoordAttribute(aContent, nsGkAtoms::increment, aIncrement);
 }
 
 PRBool
 nsGfxScrollFrameInner::ReflowFinished()
 {
   mPostedReflowCallback = PR_FALSE;
 
+  if (mOuter->GetStateBits() & (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN))
+    return PR_FALSE;
+
+  // Update scrollbar attributes.
+  nsPresContext* presContext = mOuter->PresContext();
+
   if (mMayHaveDirtyFixedChildren) {
     mMayHaveDirtyFixedChildren = PR_FALSE;
     nsIFrame* parentFrame = mOuter->GetParent();
     for (nsIFrame* fixedChild =
            parentFrame->GetFirstChild(nsGkAtoms::fixedList);
          fixedChild; fixedChild = fixedChild->GetNextSibling()) {
       // force a reflow of the fixed child
-      mOuter->PresContext()->PresShell()->
+      presContext->PresShell()->
         FrameNeedsReflow(fixedChild, nsIPresShell::eResize,
                          NS_FRAME_HAS_DIRTY_CHILDREN);
     }
   }
 
-  // Update scrollbar attributes.
-  nsPresContext* presContext = mOuter->PresContext();
-
   nsIScrollableView* scrollable = GetScrollableView();
   nsRect scrollArea = scrollable->View()->GetBounds();
 
   const nsStyleFont* font = mOuter->GetStyleFont();
   const nsFont& f = font->mFont;
   nsCOMPtr<nsIFontMetrics> fm = presContext->GetMetricsFor(f);
   nscoord fontHeight = 1;
   NS_ASSERTION(fm,"FontMetrics is null assuming fontHeight == 1");