| Index: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
|
| diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
|
| index 84137e6a7f1bffae0a73b2f14f45518666af58f0..e915c36b4412c8268759e7390e5e10db81036e69 100644
|
| --- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
|
| +++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
|
| @@ -37,6 +37,7 @@
|
| #include "platform/geometry/FloatPoint.h"
|
| #include "platform/geometry/LayoutRect.h"
|
| #include "platform/graphics/GraphicsLayer.h"
|
| +#include "platform/scroll/MainThreadScrollingReason.h"
|
| #include "platform/scroll/ProgrammaticScrollAnimator.h"
|
| #include "platform/scroll/ScrollbarTheme.h"
|
| #include "wtf/PassOwnPtr.h"
|
| @@ -530,7 +531,14 @@ void ScrollableArea::cancelProgrammaticScrollAnimation()
|
| bool ScrollableArea::shouldScrollOnMainThread() const
|
| {
|
| if (GraphicsLayer* layer = layerForScrolling()) {
|
| - return layer->platformLayer()->shouldScrollOnMainThread();
|
| + uint32_t reasons = layer->platformLayer()->mainThreadScrollingReasons();
|
| + // Should scroll on main thread unless the reason is the one that is set
|
| + // by the ScrollAnimator, in which case, the animation can still be
|
| + // scheduled on the compositor.
|
| + // TODO(ymalik): We have a non-transient "main thread scrolling reason"
|
| + // that doesn't actually cause shouldScrollOnMainThread() to be true.
|
| + // This is confusing and should be cleaned up.
|
| + return !!(reasons & ~MainThreadScrollingReason::kAnimatingScrollOnMainThread);
|
| }
|
| return true;
|
| }
|
|
|