| Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
|
| diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
|
| index 96c99893920d41e6b2880c2235d9abc580f85bd4..9c385acdc1119977e43c5b4d6a42afda9569842a 100644
|
| --- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
|
| +++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
|
| @@ -56,6 +56,7 @@
|
| #include "platform/scroll/ScrollAnimator.h"
|
| #include "platform/scroll/ScrollbarTheme.h"
|
| #include "public/platform/Platform.h"
|
| +#include "public/platform/WebCompositorAnimationTimeline.h"
|
| #include "public/platform/WebCompositorSupport.h"
|
| #include "public/platform/WebLayerPositionConstraint.h"
|
| #include "public/platform/WebScrollbarLayer.h"
|
| @@ -93,6 +94,13 @@ ScrollingCoordinator::ScrollingCoordinator(Page* page)
|
| , m_wasFrameScrollable(false)
|
| , m_lastMainThreadScrollingReasons(0)
|
| {
|
| + if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) {
|
| + ASSERT(m_page);
|
| + ASSERT(m_page->mainFrame()->isLocalFrame());
|
| + ASSERT(Platform::current()->compositorSupport());
|
| + m_programmaticScrollAnimatorTimeline = adoptPtr(Platform::current()->compositorSupport()->createAnimationTimeline());
|
| + m_page->chromeClient().attachCompositorAnimationTimeline(m_programmaticScrollAnimatorTimeline.get(), toLocalFrame(m_page->mainFrame()));
|
| + }
|
| }
|
|
|
| ScrollingCoordinator::~ScrollingCoordinator()
|
| @@ -435,7 +443,7 @@ bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
|
| if (m_page->settings().rootLayerScrolls() && isForRootLayer(scrollableArea))
|
| m_page->chromeClient().registerViewportLayers();
|
|
|
| - scrollableArea->layerForScrollingDidChange();
|
| + scrollableArea->layerForScrollingDidChange(m_programmaticScrollAnimatorTimeline.get());
|
|
|
| return !!webLayer;
|
| }
|
| @@ -723,6 +731,13 @@ void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh
|
| void ScrollingCoordinator::willBeDestroyed()
|
| {
|
| ASSERT(m_page);
|
| +
|
| + if (m_programmaticScrollAnimatorTimeline) {
|
| + ASSERT(m_page->mainFrame()->isLocalFrame());
|
| + m_page->chromeClient().detachCompositorAnimationTimeline(m_programmaticScrollAnimatorTimeline.get(), toLocalFrame(m_page->mainFrame()));
|
| + m_programmaticScrollAnimatorTimeline.clear();
|
| + }
|
| +
|
| m_page = nullptr;
|
| for (const auto& scrollbar : m_horizontalScrollbars)
|
| GraphicsLayer::unregisterContentsLayer(scrollbar.value->layer());
|
|
|