Bug 926706. When nsGfxScrollFrameInner::UpdateOverflow decides we need to update the scrollbars, don't reflow the scrollframe with NS_FRAME_IS_DIRTY since that reflows all descendants. Just reflow the frame itself and don't dirty anything else. r=tn
authorRobert O'Callahan <robert@ocallahan.org>
Thu, 17 Oct 2013 23:05:15 +1300
changeset 164931 45d9e6cd34736aadeac40925170bca7e9b42b3bd
parent 164930 a417424f9213c410910cbd85fd41d3ddb3162eed
child 164932 ceb4bd44eb3497c808cdc552be7e2acfafe81a15
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstn
bugs926706
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 926706. When nsGfxScrollFrameInner::UpdateOverflow decides we need to update the scrollbars, don't reflow the scrollframe with NS_FRAME_IS_DIRTY since that reflows all descendants. Just reflow the frame itself and don't dirty anything else. r=tn
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3766,19 +3766,25 @@ nsGfxScrollFrameInner::UpdateOverflow()
   nsIScrollableFrame* sf = do_QueryFrame(mOuter);
   ScrollbarStyles ss = sf->GetScrollbarStyles();
 
   if (ss.mVertical != NS_STYLE_OVERFLOW_HIDDEN ||
       ss.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN ||
       GetScrollPosition() != nsPoint()) {
     // If there are scrollbars, or we're not at the beginning of the pane,
     // the scroll position may change. In this case, mark the frame as
-    // needing reflow.
+    // needing reflow. Don't use NS_FRAME_IS_DIRTY as dirty as that means
+    // we have to reflow the frame and all its descendants, and we don't
+    // have to do that here. Only this frame needs to be reflowed.
     mOuter->PresContext()->PresShell()->FrameNeedsReflow(
-      mOuter, nsIPresShell::eResize, NS_FRAME_IS_DIRTY);
+      mOuter, nsIPresShell::eResize, NS_FRAME_HAS_DIRTY_CHILDREN);
+    // Ensure that next time nsHTMLScrollFrame::Reflow runs, we don't skip
+    // updating the scrollbars. (Because the overflow area of the scrolled
+    // frame has probably just been updated, Reflow won't see it change.)
+    mSkippedScrollbarLayout = true;
     return false;  // reflowing will update overflow
   }
   return mOuter->nsContainerFrame::UpdateOverflow();
 }
 
 void
 nsGfxScrollFrameInner::UpdateSticky()
 {