Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1021)

Issue 197213011: Selectively disable rubber banding on mac. (Closed)

Created:
6 years, 9 months ago by erikchen
Modified:
6 years, 9 months ago
CC:
blink-reviews, jamesr, shans, rjwright, alancutter (OOO until 2018), Mike Lawther (Google), eae+blinkwatch, Timothy Loh, abarth-chromium, dstockwell, dglazkov+blink, darktears, Steve Block, dino_apple.com, Eric Willigers
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Selectively 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} #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -1 line) Patch
M Source/platform/PlatformWheelEvent.h View 1 4 chunks +8 lines, -0 lines 0 comments Download
M Source/web/WebInputEvent.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/web/WebInputEventConversion.cpp View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/web/WebInputEventFactoryMac.mm View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M public/web/WebInputEvent.h View 1 2 2 chunks +20 lines, -0 lines 0 comments Download
M public/web/mac/WebInputEventFactory.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
erikchen
Hi thakis! The change is not ready for review, but it works locally, and I ...
6 years, 9 months ago (2014-03-14 17:43:31 UTC) #1
Nico
+Alexei, rubberband master The basic approach seems fine, but I wonder if there's a way ...
6 years, 9 months ago (2014-03-14 17:51:46 UTC) #2
erikchen
asvitkine: light ping.
6 years, 9 months ago (2014-03-17 21:05:15 UTC) #3
Alexei Svitkine (slow)
Sorry, I was thrown off by the "This change is not ready for review.". Do ...
6 years, 9 months ago (2014-03-17 21:08:08 UTC) #4
erikchen
On 2014/03/17 21:08:08, Alexei Svitkine wrote: > Sorry, I was thrown off by the "This ...
6 years, 9 months ago (2014-03-17 21:24:34 UTC) #5
Alexei Svitkine (slow)
Perhaps the two bools can be part of WheelEvent?
6 years, 9 months ago (2014-03-18 15:56:44 UTC) #6
erikchen
asvitkine: PTAL https://codereview.chromium.org/197213011/diff/1/Source/core/frame/FrameView.h File Source/core/frame/FrameView.h (right): https://codereview.chromium.org/197213011/diff/1/Source/core/frame/FrameView.h#newcode285 Source/core/frame/FrameView.h:285: // On Mac WebKit1 the underlying NSScrollView ...
6 years, 9 months ago (2014-03-20 18:04:25 UTC) #7
Alexei Svitkine (slow)
https://codereview.chromium.org/197213011/diff/80001/Source/platform/mac/ScrollElasticityController.mm File Source/platform/mac/ScrollElasticityController.mm (right): https://codereview.chromium.org/197213011/diff/80001/Source/platform/mac/ScrollElasticityController.mm#newcode422 Source/platform/mac/ScrollElasticityController.mm:422: if (m_client->pinnedInDirection(FloatSize(-wheelEvent.deltaX(), 0)) && !m_client->shouldRubberBandInDirection(ScrollLeft)) Could the pinnedInDirection() check ...
6 years, 9 months ago (2014-03-20 18:38:09 UTC) #8
erikchen
https://codereview.chromium.org/197213011/diff/80001/public/web/mac/WebInputEventFactory.h File public/web/mac/WebInputEventFactory.h (right): https://codereview.chromium.org/197213011/diff/80001/public/web/mac/WebInputEventFactory.h#newcode56 public/web/mac/WebInputEventFactory.h:56: BLINK_EXPORT static WebMouseWheelEvent mouseWheelEvent(NSEvent*, NSView*, bool canRubberbandLeft, bool canRubberbandRight); ...
6 years, 9 months ago (2014-03-20 18:44:50 UTC) #9
Alexei Svitkine (slow)
https://codereview.chromium.org/197213011/diff/80001/public/web/mac/WebInputEventFactory.h File public/web/mac/WebInputEventFactory.h (right): https://codereview.chromium.org/197213011/diff/80001/public/web/mac/WebInputEventFactory.h#newcode56 public/web/mac/WebInputEventFactory.h:56: BLINK_EXPORT static WebMouseWheelEvent mouseWheelEvent(NSEvent*, NSView*, bool canRubberbandLeft, bool canRubberbandRight); ...
6 years, 9 months ago (2014-03-20 18:50:31 UTC) #10
erikchen
asvitkine: PTAL https://codereview.chromium.org/197213011/diff/80001/Source/platform/mac/ScrollElasticityController.mm File Source/platform/mac/ScrollElasticityController.mm (right): https://codereview.chromium.org/197213011/diff/80001/Source/platform/mac/ScrollElasticityController.mm#newcode422 Source/platform/mac/ScrollElasticityController.mm:422: if (m_client->pinnedInDirection(FloatSize(-wheelEvent.deltaX(), 0)) && !m_client->shouldRubberBandInDirection(ScrollLeft)) On 2014/03/20 ...
6 years, 9 months ago (2014-03-24 22:12:04 UTC) #11
Alexei Svitkine (slow)
LGTM https://codereview.chromium.org/197213011/diff/110001/Source/platform/mac/ScrollElasticityController.h File Source/platform/mac/ScrollElasticityController.h (right): https://codereview.chromium.org/197213011/diff/110001/Source/platform/mac/ScrollElasticityController.h#newcode53 Source/platform/mac/ScrollElasticityController.h:53: // TODO(erikchen): This method is no longer used. ...
6 years, 9 months ago (2014-03-25 15:25:39 UTC) #12
erikchen
asvitkine: Looking for another quick review. I've decided to break this CL into 2 parts, ...
6 years, 9 months ago (2014-03-26 18:24:29 UTC) #13
Alexei Svitkine (slow)
LGTM, I agree the split makes things much cleaner (and avoids problems if we need ...
6 years, 9 months ago (2014-03-26 19:08:35 UTC) #14
erikchen
The CQ bit was checked by erikchen@chromium.org
6 years, 9 months ago (2014-03-26 20:10:31 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/197213011/160001
6 years, 9 months ago (2014-03-26 20:10:35 UTC) #16
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-26 20:20:34 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on blink_presubmit
6 years, 9 months ago (2014-03-26 20:20:34 UTC) #18
Nico
platform/ owners lgtm +dglazkov for public/OWNERS and web/OWNERS
6 years, 9 months ago (2014-03-26 20:22:55 UTC) #19
dglazkov
rslgtm.
6 years, 9 months ago (2014-03-26 20:29:37 UTC) #20
Nico
The CQ bit was checked by thakis@chromium.org
6 years, 9 months ago (2014-03-26 20:29:56 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikchen@chromium.org/197213011/160001
6 years, 9 months ago (2014-03-26 20:30:01 UTC) #22
commit-bot: I haz the power
6 years, 9 months ago (2014-03-26 21:14:37 UTC) #23
Message was sent while issue was closed.
Change committed as 170102

Powered by Google App Engine
This is Rietveld 408576698