Bug 1408607. mWillBuildScrollable only keeps updated during display list building. So change Is(Maybe)ScrollingActive to not use it so they are always accurate. r=mstange
authorTimothy Nikkel <tnikkel@gmail.com>
Fri, 19 May 2017 17:04:19 -0500
changeset 680873 fbbdc0131e3558ccd756655d3f01ae113ca5aa8f
parent 680780 bfdd78172197790aae1fe8b307602e1a92f27072
child 680874 3f2f733d6ab2f45eebcb044b7aa0cc32f2fe4db0
push id84661
push userbmo:ttromey@mozilla.com
push dateMon, 16 Oct 2017 14:19:39 +0000
reviewersmstange
bugs1408607
milestone58.0a1
Bug 1408607. mWillBuildScrollable only keeps updated during display list building. So change Is(Maybe)ScrollingActive to not use it so they are always accurate. r=mstange This seems like a good idea, not sure if it fixes any bugs though.
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -5052,33 +5052,37 @@ ScrollFrameHelper::IsScrollbarOnRight() 
 bool
 ScrollFrameHelper::IsMaybeScrollingActive() const
 {
   const nsStyleDisplay* disp = mOuter->StyleDisplay();
   if (disp && (disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_SCROLL)) {
     return true;
   }
 
+  nsIContent* content = mOuter->GetContent();
   return mHasBeenScrolledRecently ||
          IsAlwaysActive() ||
-         mWillBuildScrollableLayer;
+         nsLayoutUtils::HasDisplayPort(content) ||
+         nsContentUtils::HasScrollgrab(content);
 }
 
 bool
 ScrollFrameHelper::IsScrollingActive(nsDisplayListBuilder* aBuilder) const
 {
   const nsStyleDisplay* disp = mOuter->StyleDisplay();
   if (disp && (disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_SCROLL) &&
     aBuilder->IsInWillChangeBudget(mOuter, GetScrollPositionClampingScrollPortSize())) {
     return true;
   }
 
+  nsIContent* content = mOuter->GetContent();
   return mHasBeenScrolledRecently ||
          IsAlwaysActive() ||
-         mWillBuildScrollableLayer;
+         nsLayoutUtils::HasDisplayPort(content) ||
+         nsContentUtils::HasScrollgrab(content);
 }
 
 /**
  * Reflow the scroll area if it needs it and return its size. Also determine if the reflow will
  * cause any of the scrollbars to need to be reflowed.
  */
 nsresult
 nsXULScrollFrame::XULLayout(nsBoxLayoutState& aState)