Bug 1350925 part 1 - Reset the scrolled frame's ReflowOutput overflow areas before re-using it for another child reflow. r=dholbert a=gchang
authorMats Palmgren <mats@mozilla.com>
Tue, 18 Apr 2017 22:35:05 +0200
changeset 393637 8c70d11ecd10e4c26e058990848fd6464083d80a
parent 393636 ed524b425f187bdd051eacffca42bb196238a176
child 393638 5763b4d39e44d47a4e37b01cde5c8637b0a19751
push id7211
push usercbook@mozilla.com
push dateFri, 21 Apr 2017 07:44:10 +0000
treeherdermozilla-beta@89318a1e562b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, gchang
bugs1350925
milestone54.0
Bug 1350925 part 1 - Reset the scrolled frame's ReflowOutput overflow areas before re-using it for another child reflow. r=dholbert a=gchang MozReview-Commit-ID: Ct57seTFsaj
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -336,16 +336,17 @@ nsHTMLScrollFrame::TryLayout(ScrollReflo
 
   if (aAssumeVScroll != aState->mReflowedContentsWithVScrollbar ||
       (aAssumeHScroll != aState->mReflowedContentsWithHScrollbar &&
        ScrolledContentDependsOnHeight(aState))) {
     if (aAssumeHScroll != aState->mReflowedContentsWithHScrollbar) {
       nsLayoutUtils::MarkIntrinsicISizesDirtyIfDependentOnBSize(
           mHelper.mScrolledFrame);
     }
+    aKidMetrics->mOverflowAreas.Clear();
     ReflowScrolledFrame(aState, aAssumeHScroll, aAssumeVScroll, aKidMetrics,
                         false);
   }
 
   nsSize vScrollbarMinSize(0, 0);
   nsSize vScrollbarPrefSize(0, 0);
   if (mHelper.mVScrollbarBox) {
     GetScrollbarMetrics(aState->mBoxState, mHelper.mVScrollbarBox,
@@ -689,16 +690,17 @@ nsHTMLScrollFrame::ReflowContents(Scroll
     nsSize insideBorderSize =
       ComputeInsideBorderSize(aState,
                               nsSize(kidDesiredSize.Width(), kidDesiredSize.Height()));
     nsRect scrolledRect =
       mHelper.GetUnsnappedScrolledRectInternal(kidDesiredSize.ScrollableOverflow(),
                                                insideBorderSize);
     if (nsRect(nsPoint(0, 0), insideBorderSize).Contains(scrolledRect)) {
       // Let's pretend we had no scrollbars coming in here
+      kidDesiredSize.mOverflowAreas.Clear();
       ReflowScrolledFrame(aState, false, false, &kidDesiredSize, false);
     }
   }
 
   // Try vertical scrollbar settings that leave the vertical scrollbar unchanged.
   // Do this first because changing the vertical scrollbar setting is expensive,
   // forcing a reflow always.