Index: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
index 2ba8104216248a8ce57dea7de4b3e321142a4e0f..89377fea074f6c16699764812283af77c2985adc 100644 |
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
@@ -1174,6 +1174,25 @@ void GraphicsLayer::removeLinkHighlight(LinkHighlight* linkHighlight) |
updateChildList(); |
} |
+void GraphicsLayer::setMainThreadScrollingReasons(uint32_t reasons) |
+{ |
+ if (!reasons && m_scrollableArea) { |
+ // There may be a scroll animation running on the main thread. Forward |
+ // the call to the ScrollAnimator that will clear the main thread |
+ // scrolling reasons after the animation is complete. |
+ m_scrollableArea->clearMainThreadScrollingReasons(true); |
+ return; |
+ } |
+ if (WebLayer* scrollLayer = platformLayer()) { |
+ // The ScrollAnimator will override this main thread scrolling reason if |
+ // it is added while the ScrollAnimator is scheduled to clear the main |
+ // thread scrolling reason (from call above). Thus, inform it to not |
+ // clear the main thread scrolling reasons. |
+ m_scrollableArea->clearMainThreadScrollingReasons(false); |
+ scrollLayer->addMainThreadScrollingReasons(reasons); |
ajuma
2016/02/04 15:05:48
Would it simplify things if the main thread scroll
|
+ } |
+} |
+ |
void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea, bool isViewport) |
{ |
if (m_scrollableArea == scrollableArea) |