Commit 4d3444e3 authored by jdduke@chromium.org's avatar jdduke@chromium.org

Expose whether a touch event may cause scrolling if uncanceled

Currently, there are several parts of the touch pipeline that need to
know whether a touch event may cause scrolling. In particular, touchmove
events within a platform-specific slop region will not induce
scrolling, and such events are suppressed by the TouchEventQueue when
the touchstart is not prevented. The TouchEventQueue uses a slop region
constant to perform this suppression.

However, there are no guarantees that this constant is the same as that
used in gesture detection. With devtools touch emulation, it should be
possible to vary the slop region when emulating different devices, but
the duplicated slop region code in the TouchEventQueue makes this
difficult.

This solution tags each touch event with a bit indicating whether
the event may cause scrolling, allowing any listener or consumer of the
touch stream to better reason about the touch event's default action.
This tagging will be wired up in the corresponding Chromium change:
https://codereview.chromium.org/718153002

Also remove the IsLastInputEventForCurrentVSync flag as it's no
longer used.

BUG=425586

Review URL: https://codereview.chromium.org/702883004

git-svn-id: svn://svn.chromium.org/blink/trunk@185244 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2b04a0aa
...@@ -60,7 +60,7 @@ struct SameSizeAsWebGestureEvent : public SameSizeAsWebInputEvent { ...@@ -60,7 +60,7 @@ struct SameSizeAsWebGestureEvent : public SameSizeAsWebInputEvent {
struct SameSizeAsWebTouchEvent : public SameSizeAsWebInputEvent { struct SameSizeAsWebTouchEvent : public SameSizeAsWebInputEvent {
WebTouchPoint touchPoints[WebTouchEvent::touchesLengthCap]; WebTouchPoint touchPoints[WebTouchEvent::touchesLengthCap];
int touchData[2]; int touchData[3];
}; };
COMPILE_ASSERT(sizeof(WebInputEvent) == sizeof(SameSizeAsWebInputEvent), WebInputEvent_has_gaps); COMPILE_ASSERT(sizeof(WebInputEvent) == sizeof(SameSizeAsWebInputEvent), WebInputEvent_has_gaps);
......
...@@ -166,14 +166,6 @@ public: ...@@ -166,14 +166,6 @@ public:
// Left/right modifiers for keyboard events. // Left/right modifiers for keyboard events.
IsLeft = 1 << 11, IsLeft = 1 << 11,
IsRight = 1 << 12, IsRight = 1 << 12,
// Last input event to be sent for the current vsync interval. If this
// flag is set, the sender guarantees that no more input events will be
// delivered until the next vsync and the receiver can schedule
// rendering accordingly. If it isn't set, the receiver should not make
// any assumptions about the delivery times of future input events
// w.r.t. vsync.
IsLastInputEventForCurrentVSync = 1 << 13,
}; };
static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey;
...@@ -504,10 +496,19 @@ public: ...@@ -504,10 +496,19 @@ public:
// See comment at the top for why an int is used here instead of a bool. // See comment at the top for why an int is used here instead of a bool.
int cancelable; int cancelable;
// Whether the event will produce scroll-inducing events if uncanceled. This
// will be true for touchmove events after the platform slop region has been
// exceeded and fling-generating touchend events. Note that this doesn't
// necessarily mean content will scroll, only that scroll events will be
// generated.
// See comment at the top for why an int is used here instead of a bool.
int causesScrollingIfUncanceled;
WebTouchEvent() WebTouchEvent()
: WebInputEvent(sizeof(WebTouchEvent)) : WebInputEvent(sizeof(WebTouchEvent))
, touchesLength(0) , touchesLength(0)
, cancelable(true) , cancelable(true)
, causesScrollingIfUncanceled(false)
{ {
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment