Index: Source/core/page/scrolling/ScrollingCoordinator.cpp |
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp |
index 894e1c2f82949d54987dec697f895c6754ed3cfd..1bfd1b4189819e4f7894d9705a92eafd8dfe18a5 100644 |
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp |
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp |
@@ -946,8 +946,18 @@ MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co |
if (frameView->hasSlowRepaintObjects()) |
reasons |= HasSlowRepaintObjects; |
- if (frameView->isScrollable() && hasVisibleSlowRepaintViewportConstrainedObjects(frameView)) |
+ FrameView::ScrollingReasons scrollingReasons = frameView->scrollingReasons(); |
+ const bool mayBeScrolledByInput = (scrollingReasons == FrameView::Scrollable); |
+ const bool mayBeScrolledByScript = mayBeScrolledByInput || (scrollingReasons == |
+ FrameView::NotScrollableExplicitlyDisabled); |
+ |
+ // TODO(awoloszyn) Currently crbug.com/304810 will let certain |
+ // overflow:hidden elements scroll on the compositor thread, so we should |
+ // not let this move there path as an optimization, when we have slow-repaint |
+ // elements. |
+ if (mayBeScrolledByScript && hasVisibleSlowRepaintViewportConstrainedObjects(frameView)) { |
reasons |= HasNonLayerViewportConstrainedObjects; |
+ } |
return reasons; |
} |