12014-08-14 Wenson Hsieh <wenson_hsieh@apple.com>
2
3 Implement snapping behavior for iOS
4 https://bugs.webkit.org/show_bug.cgi?id=135769
5
6 Reviewed by NOBODY (OOPS!).
7
8 Added support for snap points on iOS. This entails sending snap points from the web process to the UI process
9 by encoding and decoding snap points and updating ScrollingTreeOverflowScrollingNodeIOS and WKWebView to support
10 animation to snap points in the cases of mainframe and overflow scrolling, respectively.
11
12 There are no new tests yet -- we'll need to find a way to test this!
13
14 * WebCore.exp.in:
15 * page/scrolling/AsyncScrollingCoordinator.cpp:
16 (WebCore::setStateScrollingNodeSnapOffsetsAsFloat): Helper functions used to convert LayoutUnits to floats for snap offsets.
17 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Update snap offsets for mainframe scrolling, as well as the state node.
18 (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Added snap offsets.
19 * page/scrolling/AxisScrollSnapOffsets.h:
20 (WebCore::closestSnapOffset): Computes the closest snap offset given a sorted vector of comparable types (e.g. float, LayoutUnit).
21 * page/scrolling/ScrollingCoordinator.h:
22 * page/scrolling/ScrollingStateScrollingNode.cpp:
23 (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
24 (WebCore::ScrollingStateScrollingNode::setHorizontalSnapOffsets):
25 (WebCore::ScrollingStateScrollingNode::setVerticalSnapOffsets):
26 * page/scrolling/ScrollingStateScrollingNode.h:
27 (WebCore::ScrollingStateScrollingNode::horizontalSnapOffsets):
28 (WebCore::ScrollingStateScrollingNode::verticalSnapOffsets):
29 * page/scrolling/ScrollingTreeScrollingNode.cpp:
30 (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
31 * page/scrolling/ScrollingTreeScrollingNode.h:
32 (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets):
33 (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets):
34 * rendering/RenderLayer.cpp:
35 (WebCore::RenderLayer::updateScrollInfoAfterLayout): Update snap offsets for overflow scrolling.
36 * rendering/RenderLayerCompositor.cpp:
37 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Updates the state node's snap offsets for overflow scrolling.
38