@@ -660,7 +660,7 @@ private native String nativeRetrieveImageSource(int nativeClass,
660660 int x , int y );
661661 private native boolean nativeMouseClick (int nativeClass );
662662
663- private native boolean nativeHandleTouchEvent (int nativeClass , int action ,
663+ private native int nativeHandleTouchEvent (int nativeClass , int action ,
664664 int [] idArray , int [] xArray , int [] yArray , int count ,
665665 int actionIndex , int metaState );
666666
@@ -959,6 +959,9 @@ static class TextFieldInitData {
959959 static final int ACTION_LONGPRESS = 0x100 ;
960960 static final int ACTION_DOUBLETAP = 0x200 ;
961961
962+ private static final int TOUCH_FLAG_HIT_HANDLER = 0x1 ;
963+ private static final int TOUCH_FLAG_PREVENT_DEFAULT = 0x2 ;
964+
962965 static class TouchEventData {
963966 int mAction ;
964967 int [] mIds ; // Ids of the touch points
@@ -1775,7 +1778,8 @@ public Looper getWebKitLooper() {
17751778 }
17761779
17771780 @ Override
1778- public boolean dispatchWebKitEvent (MotionEvent event , int eventType , int flags ) {
1781+ public boolean dispatchWebKitEvent (WebViewInputDispatcher dispatcher ,
1782+ MotionEvent event , int eventType , int flags ) {
17791783 if (mNativeClass == 0 ) {
17801784 return false ;
17811785 }
@@ -1802,10 +1806,16 @@ public boolean dispatchWebKitEvent(MotionEvent event, int eventType, int flags)
18021806 xArray [i ] = (int ) event .getX (i );
18031807 yArray [i ] = (int ) event .getY (i );
18041808 }
1805- return nativeHandleTouchEvent (mNativeClass ,
1809+ int touchFlags = nativeHandleTouchEvent (mNativeClass ,
18061810 event .getActionMasked (),
18071811 idArray , xArray , yArray , count ,
18081812 event .getActionIndex (), event .getMetaState ());
1813+ if (touchFlags == 0
1814+ && event .getActionMasked () != MotionEvent .ACTION_CANCEL
1815+ && (flags & WebViewInputDispatcher .FLAG_PRIVATE ) == 0 ) {
1816+ dispatcher .skipWebkitForRemainingTouchStream ();
1817+ }
1818+ return (touchFlags & TOUCH_FLAG_PREVENT_DEFAULT ) > 0 ;
18091819 }
18101820
18111821 default :
0 commit comments