[go: nahoru, domu]

Use scroll-boundary-behavior to control overscroll-refresh/glow on android.

Overscroll navigation is a feature of Chrome. Users can pull verticallly to
refresh the page on android, or swipe horizontally to browse history on desktop
platform. Overscroll-glow is a visual effect indicating user that his scroll
has passed the extent of the scroller. However, for some mobile web
applications, navigation or glow does not make sense. This patch allows users
to use a css attribute: scroll-boundary-behavior on the viewport defining
element in order to control overscroll-navigation and overscroll-glow.

On main thread, we set this property in OverscrollController, and on the
compositor thread, we plumb this property to LayerTreeImpl. When overscroll
happens, scroll-boundary-behavior is bundled in did_overscroll_params and is
passed to OverscrollControllerAndroid::Overscrolled(). Thus, we make the
decision of whether to pull-to-refresh and whether to glow on Overscrolled()
as opposed to immediately after ScrollUpdateAck.

Spec: https://wicg.github.io/scroll-boundary-behavior/
Design Doc: https://docs.google.com/a/google.com/document/d/1cqyeFamVmSu5EN5sBpQFB3Madm-41BtJEMDEbW1xdh4/edit?usp=sharing

BUG=656801
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2884423003
Cr-Commit-Position: refs/heads/master@{#498816}
54 files changed