REGRESSION(142590): Part 2: Scroll-snap points are improperly snapping to earlier...
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 May 2015 21:58:30 +0000 (21:58 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 May 2015 21:58:30 +0000 (21:58 +0000)
commit9fa8b73a53aefde6070a3b3d0032d2ae5ea7a93a
treed44bef9ae1d3944c515f8ad58c43f8820d7c5707
parente3a0ea4500e95bd7e41ace8a8505ca4f287175f4
REGRESSION(142590): Part 2: Scroll-snap points are improperly snapping to earlier index values (Scrolling Thread)
https://bugs.webkit.org/show_bug.cgi?id=145175
<rdar://problem/21023785>

Reviewed by Beth Dakin.

Source/WebCore:

Extend the main-thread scrolling changes done in Bug 145140 to also handle Scrolling Thread snapping.
The post-layout fixup (needed to handle window resize and device orientation changes) should not fire
while Scrolling Thread scroll-snap animations are running, since these animations will most likely
move the scroll view into the proper position. If we attempt to 'fix up' the scroll position before
these animations finish, we get an ugly 'jump' in the display.

* page/FrameView.cpp:
(WebCore::FrameView::isScrollSnapInProgress): New method based on isRubberBandInProgress, which considers
both the ScrollAnimator (main thread) scrolling, as well as the ScrollingCoordinator (Scrolling Thread)
scrolling operations. Returns true if a scroll-snap animation is still active.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::isScrollSnapInProgress): Added. Returns scrolling tree's
'isScrollSnapInProgress' state.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::isScrollSnapInProgress): Added default 'false' stub.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree): Use modern C++11 initializers.
(WebCore::ScrollingTree::isScrollSnapInProgress): Added.
(WebCore::ScrollingTree::setMainFrameIsScrollSnapping): Added.
* page/scrolling/ScrollingTree.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): Update scrolling tree state to match the
ScrollController's scroll-snap state.
(WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Added. When starting a scroll snap timer,
always set the scrolling tree scroll-snapping state to true.
(WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Added. When ending a scroll snap timer,
only set the scrolling tree scroll-snapping state to false if the other axis animator is inactive.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::updateScrollSnapState): Revise implementation to use its 'isScrollSnapInProgress'
method, rather than only looking at the ScrollAnimator (main thread) state.
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::isScrollSnapInProgress): Added.
* platform/cocoa/ScrollController.h:
* platform/cocoa/ScrollController.mm:
(WebCore::ScrollController::hasActiveScrollSnapTimerForAxis): Added. Reports if the scroll snap animation
timer on the requested axis is running or not.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::isScrollSnapInProgress): Added.
* rendering/RenderLayer.h:

Source/WebKit2:

Add a stub implementation of isScrollSnapInProgress to match ScrollingCoordinator signature.

* WebProcess/Scrolling/RemoteScrollingCoordinator.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress): Added stub.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184596 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/platform/cocoa/ScrollController.h
Source/WebCore/platform/cocoa/ScrollController.mm
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.h
Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm