limiting scroll chain via overscroll-behavior should impact latching |
|||
Issue descriptionIt seems that the interaction between overscroll-behvaior and scroll latching can lead to unexpected and user-hostile behavior. In particular see [1] which can be reproduced by these steps 1. go to https://ebidel.github.io/demos/chatbox.html 2. Scroll chatbox to its top so it reaches its full extent 3. Tap on chatbox and try scrolling it up passed extent, then without lifting finger try scrolling down. Expected: - When scrolling down, the chatbox (or maybe the page) should scroll down. Actual: - Nothing scrolls on the page. Note that: When scrolling up, the chatbox should not scroll (because it has reached its extent), and it should not allow the scroll to propagate to viewport (because overscroll-behavior:none;). However, when scrolling down, the chatbox should scroll but it does not. I think this is occurring because at the first scrolling up, we are not latching to the chatbox (since it does not scroll in that direction), thus on scroll down it no longer receives the scroll. A potential solution: given that chatbox is the top-most element in scroll chain then it is reasonable for it to be the *catch-all* latched element that gets latched to regardless of whether it is scrollable in that direction or not. AFAIK this is similar to how we treat the viewport. [1] https://stackoverflow.com/questions/48037405/chrome-mobile-all-children-of-body-overscroll-behavior-bug/48055055#
,
Jan 2 2018
You say that it's because of scroll latching. Do you know of anyway to force the latching to happen? My workaround was to listen on the touchstart event and move the scrollTop by 1 but is there a more elegant way?
,
Jan 2 2018
and this bug only happens on touch. Not with mouse scrolling (arrow keys and space bar inputs still propagate to the viewport don't know if this is expected behavior of overscroll-behavior).
,
Jan 3 2018
re #2: moving scrollTop by 1px ensures that the scroller is always scrollable in that direction and thus it is scrolled and latched to. I am not sure if there is a better way here to force latching. sahel@ will correct me if there is one. re #3: That is interesting. I would expect this to behave the same for touch/touchpad scrolling which have the same chaining/latching behavior but not keyboard scrolling. The scroll targeting is different for keyboard scrolling and does not involve scroll chaining and latching the same way that we do for touch/touchpad. Similarly overscroll-behavior does not apply for keyboard and scrollbar scrolling.
,
Jan 3 2018
re #2: The way latching works is to latch to the first element that can scroll in the given direction. If no such element exists the scrolling latches to the viewport. Once this bug is fixed, you can set overscroll-behavior:none for the element to which you want to force latching. In this case we will keep propagating the scroll till either one element can scroll in given direction or we reach the element with overscroll-behavior:none and latch to it regardless of the scroll direction (similar to viewport case). re #3: Wheel scroll latching is not enabled by default, make sure to enable it from chrome://flags and then try, as majidvp@ mentioned scroll latching for wheel and touch should be the same.
,
Jan 3 2018
@sahel what flag is it behind?
,
Jan 4 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7d25f2f71326cfddc2c28e559a7f37dc9fe99c8d commit 7d25f2f71326cfddc2c28e559a7f37dc9fe99c8d Author: Sandra Sun <sunyunjia@chromium.org> Date: Thu Jan 04 19:48:46 2018 Latch to the node with non-auto overscroll-behavior When we overscroll a scroller with non-auto overscroll-behavior at its scroll extent, no node will be added to the scroll chain, because the scroller can not consume the current delta. However, if we then scroll the scroller to the opposite direction in the same gesture, the scroller won't respond to that because it's not the CurrentlyScrollingNode. This patch adds the first node with non-auto overscroll-behavior to the scroll chain regardlessly, as it's the only node we can latch to, even if it cannot consume the current delta. So when we change the scroll direction, the scroller can still respond to the later events. Bug: 798543 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel Change-Id: I8baa77ae6690e095de3018cb112185f48f0854a8 Reviewed-on: https://chromium-review.googlesource.com/848314 Reviewed-by: Ali Juma <ajuma@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Commit-Queue: Sandra Sun <sunyunjia@chromium.org> Cr-Commit-Position: refs/heads/master@{#527068} [modify] https://crrev.com/7d25f2f71326cfddc2c28e559a7f37dc9fe99c8d/cc/trees/layer_tree_host_impl.cc [modify] https://crrev.com/7d25f2f71326cfddc2c28e559a7f37dc9fe99c8d/cc/trees/layer_tree_host_impl_unittest.cc [modify] https://crrev.com/7d25f2f71326cfddc2c28e559a7f37dc9fe99c8d/third_party/WebKit/Source/core/input/OverscrollBehaviorTest.cpp [modify] https://crrev.com/7d25f2f71326cfddc2c28e559a7f37dc9fe99c8d/third_party/WebKit/Source/core/input/ScrollManager.cpp
,
Jan 7 2018
,
Feb 4 2018
When will this fix drop in stable?
,
Mar 14 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by ad...@kitwebapps.com
, Jan 2 2018