DescriptionMacViews: Send Mac scrollWheel NSEvents as ui::ET_SCROLL (ui::ScrollEvent).
On Mac, mouse wheel ticks and two-finger trackpad scroll events both
arrive via -[NSView scrollWheel:]. These are currently converted to a
ui::MouseWheel. However, ui::MouseWheel doesn't have the necessary event
phase information that the cc::InputHandler needs to properly calculate
scroll elasticity.
ui::ScrollEvent is a closer fit, but Mac generates a continuous event
"stream" through the momentum portion of a scroll "flick". To support
this, add an EventMomentumPhase enum, and populate the ScrollEvent with
it. EventMomentumPhase is a simplified representation of the phase
information on the native NSEvent: it hides states that don't matter to
the scrolling machinery for the cc::InputHandler (i.e.
cc::LayerTreeHostImpl).
Elastic scrolling overview CL: http://crrev.com/2189583004
Add test coverage by fleshing out cocoa_test_event_utils::
TestScrollEvent(..). Fixes possible flakiness in tests using that method
since it didn't previously set event flags explicitly to zero. The
result could be that NSEvent uses the current global keyboard state to
populate its event flags, which could be influenced by tests running in
parallel.
BUG=355659, 615948, 640457
Committed: https://crrev.com/b94b06c07b4dada802959a10f8753d3b1a2dcc03
Cr-Commit-Position: refs/heads/master@{#421082}
Patch Set 1 #Patch Set 2 : rebase #Patch Set 3 : Mask -> Enum, more tests #Patch Set 4 : fix compile, self review #Patch Set 5 : Test is still flaky - exploring some stuff #Patch Set 6 : Fixed the flakiness \o/ #Patch Set 7 : Support Widget MouseWheelEvent conversion #
Total comments: 6
Patch Set 8 : 2 comments #Patch Set 9 : More idiomatic ObjC #
Total comments: 3
Patch Set 10 : NSDictionary subscripting #
Messages
Total messages: 51 (42 generated)
|