Bug 1253683 - Don't layerize scrollframes which are overflow:scroll but not actually scrollable. r=tnikkel
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 29 Jun 2016 14:29:40 -0400
changeset 343142 36f3e97c79d1baedb748848524f48d1e2332ca6a
parent 343141 a0bc72567903d42a8ec8dc9dc4b18a6cb0c60c44
child 343143 a5516d8f4ec8b59c7006bc4cd83db9e79632ae12
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1253683
milestone50.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 1253683 - Don't layerize scrollframes which are overflow:scroll but not actually scrollable. r=tnikkel MozReview-Commit-ID: 6DUE3PB2hLI
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1145,20 +1145,21 @@ ScrollFrameHelper::WantAsyncScroll() con
 {
   // If zooming is allowed, and this is a frame that's allowed to zoom, then
   // we want it to be async-scrollable or zooming will not be permitted.
   if (mZoomableByAPZ) {
     return true;
   }
 
   ScrollbarStyles styles = GetScrollbarStylesFromFrame();
-  uint32_t directions = mOuter->GetScrollTargetFrame()->GetPerceivedScrollingDirections();
-  bool isVScrollable = !!(directions & nsIScrollableFrame::VERTICAL) &&
+  nscoord oneDevPixel = GetScrolledFrame()->PresContext()->AppUnitsPerDevPixel();
+  nsRect scrollRange = GetScrollRange();
+  bool isVScrollable = (scrollRange.height >= oneDevPixel) &&
                        (styles.mVertical != NS_STYLE_OVERFLOW_HIDDEN);
-  bool isHScrollable = !!(directions & nsIScrollableFrame::HORIZONTAL) &&
+  bool isHScrollable = (scrollRange.width >= oneDevPixel) &&
                        (styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN);
 
 #if defined(MOZ_B2G) || defined(MOZ_WIDGET_ANDROID)
   // Mobile platforms need focus to scroll.
   bool canScrollWithoutScrollbars = IsFocused(mOuter->GetContent());
 #else
   bool canScrollWithoutScrollbars = true;
 #endif