Bug 1253683 - Don't layerize scrollframes which are overflow:scroll but not actually scrollable. r?tnikkel
MozReview-Commit-ID: 6DUE3PB2hLI
--- 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