diff options
author | John Reck <jreck@google.com> | 2012-05-16 20:12:12 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-05-16 20:34:48 -0700 |
commit | 94c478e9e59683fd552fd11b2b7b27fac78b90b4 (patch) | |
tree | 0f35fb77a37b72046376b223c88f38d09a5315c7 /core/java/android/webkit/WebViewInputDispatcher.java | |
parent | ae14715284837aebe179f790e0456d2bdb367583 (diff) | |
download | frameworks_base-94c478e9e59683fd552fd11b2b7b27fac78b90b4.zip frameworks_base-94c478e9e59683fd552fd11b2b7b27fac78b90b4.tar.gz frameworks_base-94c478e9e59683fd552fd11b2b7b27fac78b90b4.tar.bz2 |
Don't send an ontouchmove until slop is exceeded
Bug: 6490959
Change-Id: I0f447f65c84f9ce208ce52caba05e7dcb2f76bc5
Diffstat (limited to 'core/java/android/webkit/WebViewInputDispatcher.java')
-rw-r--r-- | core/java/android/webkit/WebViewInputDispatcher.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/core/java/android/webkit/WebViewInputDispatcher.java b/core/java/android/webkit/WebViewInputDispatcher.java index 9eeb311..c5a86d8 100644 --- a/core/java/android/webkit/WebViewInputDispatcher.java +++ b/core/java/android/webkit/WebViewInputDispatcher.java @@ -822,21 +822,31 @@ final class WebViewInputDispatcher { } private void enqueueEventLocked(DispatchEvent d) { - if (!shouldSkipWebKit(d.mEventType)) { + if (!shouldSkipWebKit(d)) { enqueueWebKitEventLocked(d); } else { enqueueUiEventLocked(d); } } - private boolean shouldSkipWebKit(int eventType) { - switch (eventType) { + private boolean shouldSkipWebKit(DispatchEvent d) { + switch (d.mEventType) { case EVENT_TYPE_CLICK: case EVENT_TYPE_HOVER: case EVENT_TYPE_SCROLL: case EVENT_TYPE_HIT_TEST: return false; case EVENT_TYPE_TOUCH: + // TODO: This should be cleaned up. We now have WebViewInputDispatcher + // and WebViewClassic both checking for slop and doing their own + // thing - they should be consolidated. And by consolidated, I mean + // WebViewClassic's version should just be deleted. + // The reason this is done is because webpages seem to expect + // that they only get an ontouchmove if the slop has been exceeded. + if (mIsTapCandidate && d.mEvent != null + && d.mEvent.getActionMasked() == MotionEvent.ACTION_MOVE) { + return true; + } return !mPostSendTouchEventsToWebKit || mPostDoNotSendTouchEventsToWebKitUntilNextGesture; } |