Index: content/common/input/synthetic_web_input_event_builders.cc |
diff --git a/content/common/input/synthetic_web_input_event_builders.cc b/content/common/input/synthetic_web_input_event_builders.cc |
index d3addb67918cc46a16e8e14ec3124a9db9aa6f88..ab2968a771558559bfede191c77217f6ea4e5c78 100644 |
--- a/content/common/input/synthetic_web_input_event_builders.cc |
+++ b/content/common/input/synthetic_web_input_event_builders.cc |
@@ -163,6 +163,7 @@ void SyntheticWebTouchEvent::ResetPoints() { |
} |
touchesLength = point; |
type = WebInputEvent::Undefined; |
+ causesScrollingIfUncanceled = false; |
} |
int SyntheticWebTouchEvent::PressPoint(float x, float y) { |
@@ -181,7 +182,11 @@ int SyntheticWebTouchEvent::PressPoint(float x, float y) { |
} |
void SyntheticWebTouchEvent::MovePoint(int index, float x, float y) { |
- CHECK(index >= 0 && index < touchesLengthCap); |
+ CHECK_GE(index, 0); |
+ CHECK_LT(index, touchesLengthCap); |
+ // Always set this bit to avoid otherwise unexpected touchmove suppression. |
+ // The caller can opt-out explicitly, if necessary. |
+ causesScrollingIfUncanceled = true; |
WebTouchPoint& point = touches[index]; |
point.position.x = point.screenPosition.x = x; |
point.position.y = point.screenPosition.y = y; |
@@ -191,14 +196,16 @@ void SyntheticWebTouchEvent::MovePoint(int index, float x, float y) { |
} |
void SyntheticWebTouchEvent::ReleasePoint(int index) { |
- CHECK(index >= 0 && index < touchesLengthCap); |
+ CHECK_GE(index, 0); |
+ CHECK_LT(index, touchesLengthCap); |
touches[index].state = WebTouchPoint::StateReleased; |
WebTouchEventTraits::ResetType( |
WebInputEvent::TouchEnd, timeStampSeconds, this); |
} |
void SyntheticWebTouchEvent::CancelPoint(int index) { |
- CHECK(index >= 0 && index < touchesLengthCap); |
+ CHECK_GE(index, 0); |
+ CHECK_LT(index, touchesLengthCap); |
touches[index].state = WebTouchPoint::StateCancelled; |
WebTouchEventTraits::ResetType( |
WebInputEvent::TouchCancel, timeStampSeconds, this); |