New issue
Advanced search Search tips

Issue 853292 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 15
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Add a flag for scroll direction to WebMouseWheelEvent

Project Member Reported by ekaramad@chromium.org, Jun 15 2018

Issue description

It is a bit unclear how a mouse wheel would scroll: With trackpads we get deltaX and deltaY so the bigger of the two in magnitude could suggest the direction. When using mouse, there is only deltaY. On some platforms Shift + deltaY means horizontal scroll while on Mac is seems to do nothing.

Also, pressing shift does not seem to have any effect on trackpad scrolling.

It would be quite helpful to tag a WebMouseWheelEvent with at least a provisional direction of scrolling.
 
Dave, does the bug make sense to you (am I missing something?).
Can you explain the motivation? WebMouseWheelEvent shouldn't scroll at all.

The default action in the browser is to generate a WebGestureScroll event that causes scrolling. I'd prefer if we actually removed all scrolling related notions from WebMouseWheelEvent however it gets generated at a level where some abstraction is lost.
Yes but canceling the event should block wheel scroll (for more context PTAL: https://chromium-review.googlesource.com/c/chromium/src/+/1073729/7/third_party/blink/renderer/core/input/mouse_wheel_event_manager.cc#118).

There the suggested code is trying to guess the direction of scroll due to wheel input.
Ya I agree that is ugly. I don't have a better idea at this moment than you've suggested in #1.
Sure. I will put something together and send for review then. Thanks!
Components: Internals>Input Blink>Input
Status: Started (was: Available)
Project Member

Comment 8 by bugdroid1@chromium.org, Sep 6

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0f83cb1144458236c70e3304039e00f79658e8f5

commit 0f83cb1144458236c70e3304039e00f79658e8f5
Author: Ehsan Karamad <ekaramad@chromium.org>
Date: Thu Sep 06 22:07:36 2018

EventAction for WebMouseWheelEvent

When a wheel event is not consumed it will lead into either scroll or
page zoom.

This CL adds an enum type EventAction and a corresponding getter on
WebMouseWheelEvent to clarify the action associated with a wheel event
(should it not get canceled by a handler). This field simplifies the
logic around finding scroll direction with use cases in feature policy
vertical-scroll.

Bug:  853292 
Change-Id: I3d554d6b97189ed63911d97607cf7cb03bfab64a
Reviewed-on: https://chromium-review.googlesource.com/1127347
Reviewed-by: Ehsan Karamad <ekaramad@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589330}
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/browser/renderer_host/input/mouse_wheel_event_queue.cc
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/browser/web_contents/web_contents_impl.cc
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/common/BUILD.gn
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/common/input/input_event_struct_traits.cc
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/common/input/input_handler.mojom
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/common/input/synthetic_web_input_event_builders.cc
[add] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/common/input/web_mouse_wheel_event_traits.cc
[add] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/common/input/web_mouse_wheel_event_traits.h
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/content/shell/test_runner/event_sender.cc
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/third_party/blink/public/platform/web_mouse_wheel_event.h
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/third_party/blink/renderer/core/input/mouse_wheel_event_manager.cc
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/third_party/blink/renderer/platform/exported/web_input_event.cc
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/ui/events/blink/web_input_event_traits.cc
[modify] https://crrev.com/0f83cb1144458236c70e3304039e00f79658e8f5/ui/events/blink/web_input_event_traits.h

Fix as of comment #8 's CL.
Status: Fixed (was: Started)
Marking as fixed for real this time.

Sign in to add a comment