DescriptionSelectively disable rubber banding on mac.
The logic for handling 2-finger swipes should be:
1. If a 2-finger swipe can scroll the content (or iframe), it should do so.
2. If the 2-finger swipe can cause history navigation, it should do so.
3. The 2-finger swipe should rubber-band the content view.
(2) is handled by the embedder, and (1 & 3) by the renderer. Right now, the
renderer is passed an IPC, and it tries to do (1), and then it tries to do (3).
I've added a new IPC so that there are flags that prevent the renderer from
performing (3) under specific circumstances.
There was an existing mechanism to determine whether the renderer should try
(3), but it was fragile, incorrectly used, and insufficient for newer features
in chrome - the user can cancel a history swipe without cancelling the gesture,
at which point rubber-banding should be possible again. I've simplified and
fixed the logic inside ScrollElasticityController.mm to reflect the desired
behavior.
I modified the IPC InputMsg_HandleInputEvent to include 2 additional bools:
can_rubberband_left and can_rubberband_right. Blink will attempt to consume the
event to scroll the content view, and will only attempt to rubberband if bools
allow it too.
This is part 1 of a two-part change. It only includes the IPC change. The
changes to ScrollElasticityController will land after I've updated Chromium to
use the new API.
BUG=321437
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=170102
Patch Set 1 #
Total comments: 4
Patch Set 2 : Not ready for review. #Patch Set 3 : Moved can_rubberband parameters into WheelEvent. #
Total comments: 7
Patch Set 4 : Update the behavior to be correct. :D #
Total comments: 7
Patch Set 5 : Address comments from asvitkine. #Patch Set 6 : Remove all changes to ScrollElasticityController.{h,mm} #
Messages
Total messages: 23 (0 generated)
|