Loading core/java/android/webkit/WebView.java +91 −80 Original line number Diff line number Diff line Loading @@ -476,6 +476,7 @@ public class WebView extends AbsoluteLayout private static final int TOUCH_DRAG_LAYER_MODE = 9; // Whether to forward the touch events to WebCore // Can only be set by WebKit via JNI. private boolean mForwardTouchEvents = false; // Whether to prevent default during touch. The initial value depends on Loading Loading @@ -5358,26 +5359,26 @@ public class WebView extends AbsoluteLayout + " numPointers=" + ev.getPointerCount()); } // Always pass multi-touch event to WebKit first. // If WebKit doesn't consume it and set preventDefault to true, // WebView's private handler will handle it. if (ev.getPointerCount() > 1) { if (DebugFlags.WEB_VIEW) { Log.v(LOGTAG, "passing " + ev.getPointerCount() + " points to webkit"); } if (!mIsHandlingMultiTouch) { int action = ev.getActionMasked(); if (ev.getPointerCount() > 1) { // Multi-touch mIsHandlingMultiTouch = true; } // If WebKit already showed no interests in this sequence of events, // WebView handles them directly. if (mPreventDefault == PREVENT_DEFAULT_NO && action == MotionEvent.ACTION_MOVE) { handleMultiTouchInWebView(ev); } else { passMultiTouchToWebKit(ev); } return true; } else { } // Skip ACTION_MOVE for single touch if it's still handling multi-touch. if (mIsHandlingMultiTouch && ev.getActionMasked() == MotionEvent.ACTION_MOVE) { if (mIsHandlingMultiTouch && action == MotionEvent.ACTION_MOVE) { return false; } } return handleTouchEventCommon(ev, ev.getActionMasked(), Math.round(ev.getX()), Math.round(ev.getY())); return handleTouchEventCommon(ev, action, Math.round(ev.getX()), Math.round(ev.getY())); } /* Loading Loading @@ -7357,16 +7358,25 @@ public class WebView extends AbsoluteLayout if (mPreventDefault == PREVENT_DEFAULT_YES) { mTouchHighlightRegion.setEmpty(); } } else if (msg.arg2 == 0) { // prevent default is not called in WebCore, so the // message needs to be reprocessed in UI } else { TouchEventData ted = (TouchEventData) msg.obj; if (ted.mPoints.length > 1) { // for multi-touch. if (ted.mPoints.length > 1) { // multi-touch if (ted.mAction == MotionEvent.ACTION_POINTER_UP) { mIsHandlingMultiTouch = false; } if (msg.arg2 == 0) { mPreventDefault = PREVENT_DEFAULT_NO; handleMultiTouchInWebView(ted.mMotionEvent); } else { mPreventDefault = PREVENT_DEFAULT_YES; } break; } // prevent default is not called in WebCore, so the // message needs to be reprocessed in UI if (msg.arg2 == 0) { // Following is for single touch. switch (ted.mAction) { case MotionEvent.ACTION_DOWN: Loading Loading @@ -7428,6 +7438,7 @@ public class WebView extends AbsoluteLayout break; } } } break; case REQUEST_KEYBOARD: Loading Loading
core/java/android/webkit/WebView.java +91 −80 Original line number Diff line number Diff line Loading @@ -476,6 +476,7 @@ public class WebView extends AbsoluteLayout private static final int TOUCH_DRAG_LAYER_MODE = 9; // Whether to forward the touch events to WebCore // Can only be set by WebKit via JNI. private boolean mForwardTouchEvents = false; // Whether to prevent default during touch. The initial value depends on Loading Loading @@ -5358,26 +5359,26 @@ public class WebView extends AbsoluteLayout + " numPointers=" + ev.getPointerCount()); } // Always pass multi-touch event to WebKit first. // If WebKit doesn't consume it and set preventDefault to true, // WebView's private handler will handle it. if (ev.getPointerCount() > 1) { if (DebugFlags.WEB_VIEW) { Log.v(LOGTAG, "passing " + ev.getPointerCount() + " points to webkit"); } if (!mIsHandlingMultiTouch) { int action = ev.getActionMasked(); if (ev.getPointerCount() > 1) { // Multi-touch mIsHandlingMultiTouch = true; } // If WebKit already showed no interests in this sequence of events, // WebView handles them directly. if (mPreventDefault == PREVENT_DEFAULT_NO && action == MotionEvent.ACTION_MOVE) { handleMultiTouchInWebView(ev); } else { passMultiTouchToWebKit(ev); } return true; } else { } // Skip ACTION_MOVE for single touch if it's still handling multi-touch. if (mIsHandlingMultiTouch && ev.getActionMasked() == MotionEvent.ACTION_MOVE) { if (mIsHandlingMultiTouch && action == MotionEvent.ACTION_MOVE) { return false; } } return handleTouchEventCommon(ev, ev.getActionMasked(), Math.round(ev.getX()), Math.round(ev.getY())); return handleTouchEventCommon(ev, action, Math.round(ev.getX()), Math.round(ev.getY())); } /* Loading Loading @@ -7357,16 +7358,25 @@ public class WebView extends AbsoluteLayout if (mPreventDefault == PREVENT_DEFAULT_YES) { mTouchHighlightRegion.setEmpty(); } } else if (msg.arg2 == 0) { // prevent default is not called in WebCore, so the // message needs to be reprocessed in UI } else { TouchEventData ted = (TouchEventData) msg.obj; if (ted.mPoints.length > 1) { // for multi-touch. if (ted.mPoints.length > 1) { // multi-touch if (ted.mAction == MotionEvent.ACTION_POINTER_UP) { mIsHandlingMultiTouch = false; } if (msg.arg2 == 0) { mPreventDefault = PREVENT_DEFAULT_NO; handleMultiTouchInWebView(ted.mMotionEvent); } else { mPreventDefault = PREVENT_DEFAULT_YES; } break; } // prevent default is not called in WebCore, so the // message needs to be reprocessed in UI if (msg.arg2 == 0) { // Following is for single touch. switch (ted.mAction) { case MotionEvent.ACTION_DOWN: Loading Loading @@ -7428,6 +7438,7 @@ public class WebView extends AbsoluteLayout break; } } } break; case REQUEST_KEYBOARD: Loading