Program: 21818
Project: 21818
Buggy source:
@Override public boolean onTouchEvent(MotionEvent ev){
  if (mNativeClass == 0 || (!isClickable() && !isLongClickable())) {
    return false;
  }
  if (DebugFlags.WEB_VIEW) {
    Log.v(LOGTAG,ev + "String_Node_Str" + ev.getEventTime()+ "String_Node_Str"+ mTouchMode);
  }
  int action;
  float x, y;
  long eventTime=ev.getEventTime();
  if (mSupportMultiTouch && ev.getPointerCount() > 1) {
    if (mAllowPanAndScale || mMinZoomScale < mMaxZoomScale) {
      mScaleDetector.onTouchEvent(ev);
      if (mScaleDetector.isInProgress()) {
        mLastTouchTime=eventTime;
        if (!mAllowPanAndScale) {
          return true;
        }
      }
      x=mScaleDetector.getFocusX();
      y=mScaleDetector.getFocusY();
      action=ev.getAction() & MotionEvent.ACTION_MASK;
      if (action == MotionEvent.ACTION_POINTER_DOWN) {
        cancelTouch();
        action=MotionEvent.ACTION_DOWN;
      }
 else       if (action == MotionEvent.ACTION_POINTER_UP) {
        mLastTouchX=x;
        mLastTouchY=y;
      }
 else       if (action == MotionEvent.ACTION_MOVE) {
        if (x < 0 || y < 0) {
          return true;
        }
      }
    }
 else {
      return true;
    }
  }
 else {
    action=ev.getAction();
    x=ev.getX();
    y=ev.getY();
  }
  if (x > getViewWidth() - 1) {
    x=getViewWidth() - 1;
  }
  if (y > getViewHeightWithTitle() - 1) {
    y=getViewHeightWithTitle() - 1;
  }
  float fDeltaX=mLastTouchX - x;
  float fDeltaY=mLastTouchY - y;
  int deltaX=(int)fDeltaX;
  int deltaY=(int)fDeltaY;
  int contentX=viewToContentX((int)x + mScrollX);
  int contentY=viewToContentY((int)y + mScrollY);
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mPreventDefault=PREVENT_DEFAULT_NO;
      mConfirmMove=false;
      if (!mScroller.isFinished()) {
        mScroller.abortAnimation();
        mTouchMode=TOUCH_DRAG_START_MODE;
        mConfirmMove=true;
        mPrivateHandler.removeMessages(RESUME_WEBCORE_PRIORITY);
      }
 else       if (mPrivateHandler.hasMessages(RELEASE_SINGLE_TAP)) {
        mPrivateHandler.removeMessages(RELEASE_SINGLE_TAP);
        if (deltaX * deltaX + deltaY * deltaY < mDoubleTapSlopSquare) {
          mTouchMode=TOUCH_DOUBLE_TAP_MODE;
        }
 else {
          doShortPress();
          mTouchMode=TOUCH_INIT_MODE;
          mDeferTouchProcess=(!inFullScreenMode() && mForwardTouchEvents) ? hitFocusedPlugin(contentX,contentY) : false;
        }
      }
 else {
        mPreviewZoomOnly=false;
        mTouchMode=TOUCH_INIT_MODE;
        mDeferTouchProcess=(!inFullScreenMode() && mForwardTouchEvents) ? hitFocusedPlugin(contentX,contentY) : false;
        mWebViewCore.sendMessage(EventHub.UPDATE_FRAME_CACHE_IF_LOADING);
        if (mLogEvent && eventTime - mLastTouchUpTime < 1000) {
          EventLog.writeEvent(EventLogTags.BROWSER_DOUBLE_TAP_DURATION,(eventTime - mLastTouchUpTime),eventTime);
        }
        if (mSelectingText) {
          mDrawSelectionPointer=false;
          mSelectionStarted=nativeStartSelection(contentX,contentY);
          if (DebugFlags.WEB_VIEW) {
            Log.v(LOGTAG,"String_Node_Str" + contentX + "String_Node_Str"+ contentY);
          }
          invalidate();
        }
      }
      if (mTouchMode == TOUCH_INIT_MODE || mTouchMode == TOUCH_DOUBLE_TAP_MODE) {
        mPrivateHandler.sendEmptyMessageDelayed(SWITCH_TO_SHORTPRESS,TAP_TIMEOUT);
        mPrivateHandler.sendEmptyMessageDelayed(SWITCH_TO_LONGPRESS,LONG_PRESS_TIMEOUT);
        if (inFullScreenMode() || mDeferTouchProcess) {
          mPreventDefault=PREVENT_DEFAULT_YES;
        }
 else         if (mForwardTouchEvents) {
          mPreventDefault=PREVENT_DEFAULT_MAYBE_YES;
        }
 else {
          mPreventDefault=PREVENT_DEFAULT_NO;
        }
        if (shouldForwardTouchEvent()) {
          TouchEventData ted=new TouchEventData();
          ted.mAction=action;
          ted.mX=contentX;
          ted.mY=contentY;
          ted.mMetaState=ev.getMetaState();
          ted.mReprocess=mDeferTouchProcess;
          if (mDeferTouchProcess) {
            mLastTouchX=x;
            mLastTouchY=y;
            ted.mViewX=x;
            ted.mViewY=y;
            mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
            break;
          }
          mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
          if (!inFullScreenMode()) {
            mPrivateHandler.sendMessageDelayed(mPrivateHandler.obtainMessage(PREVENT_DEFAULT_TIMEOUT,action,0),TAP_TIMEOUT);
          }
        }
      }
      startTouch(x,y,eventTime);
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    boolean firstMove=false;
    if (!mConfirmMove && (deltaX * deltaX + deltaY * deltaY) >= mTouchSlopSquare) {
      mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
      mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
      mConfirmMove=true;
      firstMove=true;
      if (mTouchMode == TOUCH_DOUBLE_TAP_MODE) {
        mTouchMode=TOUCH_INIT_MODE;
      }
    }
    if (shouldForwardTouchEvent() && mConfirmMove && (firstMove || eventTime - mLastSentTouchTime > mCurrentTouchInterval)) {
      mLastSentTouchTime=eventTime;
      TouchEventData ted=new TouchEventData();
      ted.mAction=action;
      ted.mX=contentX;
      ted.mY=contentY;
      ted.mMetaState=ev.getMetaState();
      ted.mReprocess=mDeferTouchProcess;
      if (mDeferTouchProcess) {
        ted.mViewX=x;
        ted.mViewY=y;
        mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
        break;
      }
      mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
      if (firstMove && !inFullScreenMode()) {
        mPrivateHandler.sendMessageDelayed(mPrivateHandler.obtainMessage(PREVENT_DEFAULT_TIMEOUT,action,0),TAP_TIMEOUT);
      }
    }
    if (mTouchMode == TOUCH_DONE_MODE || mPreventDefault == PREVENT_DEFAULT_YES) {
      break;
    }
    if (mVelocityTracker == null) {
      Log.e(LOGTAG,"String_Node_Str" + "String_Node_Str" + mPreventDefault + "String_Node_Str"+ mDeferTouchProcess+ "String_Node_Str"+ mTouchMode);
    }
    mVelocityTracker.addMovement(ev);
    if (mSelectingText && mSelectionStarted) {
      if (DebugFlags.WEB_VIEW) {
        Log.v(LOGTAG,"String_Node_Str" + contentX + "String_Node_Str"+ contentY);
      }
      nativeExtendSelection(contentX,contentY);
      invalidate();
      break;
    }
    if (mTouchMode != TOUCH_DRAG_MODE) {
      if (!mConfirmMove) {
        break;
      }
      if (mPreventDefault == PREVENT_DEFAULT_MAYBE_YES || mPreventDefault == PREVENT_DEFAULT_NO_FROM_TOUCH_DOWN) {
        mLastTouchTime=eventTime;
        break;
      }
      if (mScaleDetector != null && !mScaleDetector.isInProgress()) {
        int ax=Math.abs(deltaX);
        int ay=Math.abs(deltaY);
        if (ax > MAX_SLOPE_FOR_DIAG * ay) {
          mSnapScrollMode=SNAP_X;
          mSnapPositive=deltaX > 0;
        }
 else         if (ay > MAX_SLOPE_FOR_DIAG * ax) {
          mSnapScrollMode=SNAP_Y;
          mSnapPositive=deltaY > 0;
        }
      }
      mTouchMode=TOUCH_DRAG_MODE;
      mLastTouchX=x;
      mLastTouchY=y;
      fDeltaX=0.0f;
      fDeltaY=0.0f;
      deltaX=0;
      deltaY=0;
      startDrag();
    }
    if (mDragTrackerHandler != null) {
      mDragTrackerHandler.dragTo(x,y);
    }
    boolean done=false;
    boolean keepScrollBarsVisible=false;
    if (Math.abs(fDeltaX) < 1.0f && Math.abs(fDeltaY) < 1.0f) {
      mLastTouchX=x;
      mLastTouchY=y;
      keepScrollBarsVisible=done=true;
    }
 else {
      if (mSnapScrollMode == SNAP_X || mSnapScrollMode == SNAP_Y) {
        int ax=Math.abs(deltaX);
        int ay=Math.abs(deltaY);
        if (mSnapScrollMode == SNAP_X) {
          if (ay > MAX_SLOPE_FOR_DIAG * ax && ay > MIN_BREAK_SNAP_CROSS_DISTANCE) {
            mSnapScrollMode=SNAP_NONE;
          }
          if (ax > MAX_SLOPE_FOR_DIAG * ay && (mSnapPositive ? deltaX < -mMinLockSnapReverseDistance : deltaX > mMinLockSnapReverseDistance)) {
            mSnapScrollMode|=SNAP_LOCK;
          }
        }
 else {
          if (ax > MAX_SLOPE_FOR_DIAG * ay && ax > MIN_BREAK_SNAP_CROSS_DISTANCE) {
            mSnapScrollMode=SNAP_NONE;
          }
          if (ay > MAX_SLOPE_FOR_DIAG * ax && (mSnapPositive ? deltaY < -mMinLockSnapReverseDistance : deltaY > mMinLockSnapReverseDistance)) {
            mSnapScrollMode|=SNAP_LOCK;
          }
        }
      }
      if (mSnapScrollMode != SNAP_NONE) {
        if ((mSnapScrollMode & SNAP_X) == SNAP_X) {
          deltaY=0;
        }
 else {
          deltaX=0;
        }
      }
      if ((deltaX | deltaY) != 0) {
        if (deltaX != 0) {
          mLastTouchX=x;
        }
        if (deltaY != 0) {
          mLastTouchY=y;
        }
        mHeldMotionless=MOTIONLESS_FALSE;
      }
 else {
        mLastTouchX=x;
        mLastTouchY=y;
        keepScrollBarsVisible=true;
      }
      mLastTouchTime=eventTime;
      mUserScroll=true;
    }
    doDrag(deltaX,deltaY);
    if (keepScrollBarsVisible) {
      if (mHeldMotionless != MOTIONLESS_TRUE) {
        mHeldMotionless=MOTIONLESS_TRUE;
        invalidate();
      }
      awakenScrollBars(ViewConfiguration.getScrollDefaultDelay(),false);
      return !done;
    }
    break;
  }
case MotionEvent.ACTION_UP:
{
  if (shouldForwardTouchEvent()) {
    TouchEventData ted=new TouchEventData();
    ted.mAction=action;
    ted.mX=contentX;
    ted.mY=contentY;
    ted.mMetaState=ev.getMetaState();
    ted.mReprocess=mDeferTouchProcess;
    if (mDeferTouchProcess) {
      ted.mViewX=x;
      ted.mViewY=y;
    }
    mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
  }
  mLastTouchUpTime=eventTime;
switch (mTouchMode) {
case TOUCH_DOUBLE_TAP_MODE:
    mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
  mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
if (inFullScreenMode() || mDeferTouchProcess) {
  TouchEventData ted=new TouchEventData();
  ted.mAction=WebViewCore.ACTION_DOUBLETAP;
  ted.mX=contentX;
  ted.mY=contentY;
  ted.mMetaState=ev.getMetaState();
  ted.mReprocess=mDeferTouchProcess;
  if (mDeferTouchProcess) {
    ted.mViewX=x;
    ted.mViewY=y;
  }
  mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
}
 else if (mPreventDefault != PREVENT_DEFAULT_YES) {
  doDoubleTap();
  mTouchMode=TOUCH_DONE_MODE;
}
break;
case TOUCH_INIT_MODE:
case TOUCH_SHORTPRESS_START_MODE:
case TOUCH_SHORTPRESS_MODE:
mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
if (mConfirmMove) {
Log.w(LOGTAG,"String_Node_Str" + "String_Node_Str");
if (mPreventDefault != PREVENT_DEFAULT_YES && (computeMaxScrollX() > 0 || computeMaxScrollY() > 0)) {
cancelWebCoreTouchEvent(contentX,contentY,true);
WebViewCore.reducePriority();
WebViewCore.pauseUpdatePicture(mWebViewCore);
}
 else {
invalidate();
break;
}
}
 else {
if (mSelectingText) {
if (nativeHitSelection(contentX,contentY)) {
copySelection();
}
selectionDone();
break;
}
if (mTouchMode == TOUCH_INIT_MODE) {
mPrivateHandler.sendEmptyMessageDelayed(RELEASE_SINGLE_TAP,ViewConfiguration.getDoubleTapTimeout());
}
 else {
doShortPress();
}
break;
}
case TOUCH_DRAG_MODE:
mPrivateHandler.removeMessages(DRAG_HELD_MOTIONLESS);
mPrivateHandler.removeMessages(AWAKEN_SCROLL_BARS);
if (eventTime - mLastTouchTime <= MIN_FLING_TIME) {
if (mVelocityTracker == null) {
Log.e(LOGTAG,"String_Node_Str" + "String_Node_Str" + mPreventDefault + "String_Node_Str"+ mDeferTouchProcess);
}
mVelocityTracker.addMovement(ev);
mHeldMotionless=MOTIONLESS_IGNORE;
doFling();
break;
}
 else {
if (mScroller.springBack(mScrollX,mScrollY,0,computeMaxScrollX(),0,computeMaxScrollY())) {
invalidate();
}
}
mHeldMotionless=MOTIONLESS_TRUE;
invalidate();
case TOUCH_DRAG_START_MODE:
mLastVelocity=0;
WebViewCore.resumePriority();
WebViewCore.resumeUpdatePicture(mWebViewCore);
break;
}
stopTouch();
break;
}
case MotionEvent.ACTION_CANCEL:
{
if (mTouchMode == TOUCH_DRAG_MODE) {
mScroller.springBack(mScrollX,mScrollY,0,computeMaxScrollX(),0,computeMaxScrollY());
invalidate();
}
cancelWebCoreTouchEvent(contentX,contentY,false);
cancelTouch();
break;
}
}
return true;
}

Fixed version (ground truth):
@Override public boolean onTouchEvent(MotionEvent ev){
  if (mNativeClass == 0 || (!isClickable() && !isLongClickable())) {
    return false;
  }
  if (DebugFlags.WEB_VIEW) {
    Log.v(LOGTAG,ev + "String_Node_Str" + ev.getEventTime()+ "String_Node_Str"+ mTouchMode);
  }
  int action;
  float x, y;
  long eventTime=ev.getEventTime();
  if (mSupportMultiTouch && ev.getPointerCount() > 1) {
    if (mAllowPanAndScale || mMinZoomScale < mMaxZoomScale) {
      mScaleDetector.onTouchEvent(ev);
      if (mScaleDetector.isInProgress()) {
        mLastTouchTime=eventTime;
        if (!mAllowPanAndScale) {
          return true;
        }
        mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
        mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
      }
      x=mScaleDetector.getFocusX();
      y=mScaleDetector.getFocusY();
      action=ev.getAction() & MotionEvent.ACTION_MASK;
      if (action == MotionEvent.ACTION_POINTER_DOWN) {
        cancelTouch();
        action=MotionEvent.ACTION_DOWN;
      }
 else       if (action == MotionEvent.ACTION_POINTER_UP) {
        mLastTouchX=x;
        mLastTouchY=y;
      }
 else       if (action == MotionEvent.ACTION_MOVE) {
        if (x < 0 || y < 0) {
          return true;
        }
      }
    }
 else {
      return true;
    }
  }
 else {
    action=ev.getAction();
    x=ev.getX();
    y=ev.getY();
  }
  if (x > getViewWidth() - 1) {
    x=getViewWidth() - 1;
  }
  if (y > getViewHeightWithTitle() - 1) {
    y=getViewHeightWithTitle() - 1;
  }
  float fDeltaX=mLastTouchX - x;
  float fDeltaY=mLastTouchY - y;
  int deltaX=(int)fDeltaX;
  int deltaY=(int)fDeltaY;
  int contentX=viewToContentX((int)x + mScrollX);
  int contentY=viewToContentY((int)y + mScrollY);
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mPreventDefault=PREVENT_DEFAULT_NO;
      mConfirmMove=false;
      if (!mScroller.isFinished()) {
        mScroller.abortAnimation();
        mTouchMode=TOUCH_DRAG_START_MODE;
        mConfirmMove=true;
        mPrivateHandler.removeMessages(RESUME_WEBCORE_PRIORITY);
      }
 else       if (mPrivateHandler.hasMessages(RELEASE_SINGLE_TAP)) {
        mPrivateHandler.removeMessages(RELEASE_SINGLE_TAP);
        if (deltaX * deltaX + deltaY * deltaY < mDoubleTapSlopSquare) {
          mTouchMode=TOUCH_DOUBLE_TAP_MODE;
        }
 else {
          doShortPress();
          mTouchMode=TOUCH_INIT_MODE;
          mDeferTouchProcess=(!inFullScreenMode() && mForwardTouchEvents) ? hitFocusedPlugin(contentX,contentY) : false;
        }
      }
 else {
        mPreviewZoomOnly=false;
        mTouchMode=TOUCH_INIT_MODE;
        mDeferTouchProcess=(!inFullScreenMode() && mForwardTouchEvents) ? hitFocusedPlugin(contentX,contentY) : false;
        mWebViewCore.sendMessage(EventHub.UPDATE_FRAME_CACHE_IF_LOADING);
        if (mLogEvent && eventTime - mLastTouchUpTime < 1000) {
          EventLog.writeEvent(EventLogTags.BROWSER_DOUBLE_TAP_DURATION,(eventTime - mLastTouchUpTime),eventTime);
        }
        if (mSelectingText) {
          mDrawSelectionPointer=false;
          mSelectionStarted=nativeStartSelection(contentX,contentY);
          if (DebugFlags.WEB_VIEW) {
            Log.v(LOGTAG,"String_Node_Str" + contentX + "String_Node_Str"+ contentY);
          }
          invalidate();
        }
      }
      if (mTouchMode == TOUCH_INIT_MODE || mTouchMode == TOUCH_DOUBLE_TAP_MODE) {
        mPrivateHandler.sendEmptyMessageDelayed(SWITCH_TO_SHORTPRESS,TAP_TIMEOUT);
        mPrivateHandler.sendEmptyMessageDelayed(SWITCH_TO_LONGPRESS,LONG_PRESS_TIMEOUT);
        if (inFullScreenMode() || mDeferTouchProcess) {
          mPreventDefault=PREVENT_DEFAULT_YES;
        }
 else         if (mForwardTouchEvents) {
          mPreventDefault=PREVENT_DEFAULT_MAYBE_YES;
        }
 else {
          mPreventDefault=PREVENT_DEFAULT_NO;
        }
        if (shouldForwardTouchEvent()) {
          TouchEventData ted=new TouchEventData();
          ted.mAction=action;
          ted.mX=contentX;
          ted.mY=contentY;
          ted.mMetaState=ev.getMetaState();
          ted.mReprocess=mDeferTouchProcess;
          if (mDeferTouchProcess) {
            mLastTouchX=x;
            mLastTouchY=y;
            ted.mViewX=x;
            ted.mViewY=y;
            mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
            break;
          }
          mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
          if (!inFullScreenMode()) {
            mPrivateHandler.sendMessageDelayed(mPrivateHandler.obtainMessage(PREVENT_DEFAULT_TIMEOUT,action,0),TAP_TIMEOUT);
          }
        }
      }
      startTouch(x,y,eventTime);
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    boolean firstMove=false;
    if (!mConfirmMove && (deltaX * deltaX + deltaY * deltaY) >= mTouchSlopSquare) {
      mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
      mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
      mConfirmMove=true;
      firstMove=true;
      if (mTouchMode == TOUCH_DOUBLE_TAP_MODE) {
        mTouchMode=TOUCH_INIT_MODE;
      }
    }
    if (shouldForwardTouchEvent() && mConfirmMove && (firstMove || eventTime - mLastSentTouchTime > mCurrentTouchInterval)) {
      mLastSentTouchTime=eventTime;
      TouchEventData ted=new TouchEventData();
      ted.mAction=action;
      ted.mX=contentX;
      ted.mY=contentY;
      ted.mMetaState=ev.getMetaState();
      ted.mReprocess=mDeferTouchProcess;
      if (mDeferTouchProcess) {
        ted.mViewX=x;
        ted.mViewY=y;
        mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
        break;
      }
      mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
      if (firstMove && !inFullScreenMode()) {
        mPrivateHandler.sendMessageDelayed(mPrivateHandler.obtainMessage(PREVENT_DEFAULT_TIMEOUT,action,0),TAP_TIMEOUT);
      }
    }
    if (mTouchMode == TOUCH_DONE_MODE || mPreventDefault == PREVENT_DEFAULT_YES) {
      break;
    }
    if (mVelocityTracker == null) {
      Log.e(LOGTAG,"String_Node_Str" + "String_Node_Str" + mPreventDefault + "String_Node_Str"+ mDeferTouchProcess+ "String_Node_Str"+ mTouchMode);
    }
    mVelocityTracker.addMovement(ev);
    if (mSelectingText && mSelectionStarted) {
      if (DebugFlags.WEB_VIEW) {
        Log.v(LOGTAG,"String_Node_Str" + contentX + "String_Node_Str"+ contentY);
      }
      nativeExtendSelection(contentX,contentY);
      invalidate();
      break;
    }
    if (mTouchMode != TOUCH_DRAG_MODE) {
      if (!mConfirmMove) {
        break;
      }
      if (mPreventDefault == PREVENT_DEFAULT_MAYBE_YES || mPreventDefault == PREVENT_DEFAULT_NO_FROM_TOUCH_DOWN) {
        mLastTouchTime=eventTime;
        break;
      }
      if (mScaleDetector != null && !mScaleDetector.isInProgress()) {
        int ax=Math.abs(deltaX);
        int ay=Math.abs(deltaY);
        if (ax > MAX_SLOPE_FOR_DIAG * ay) {
          mSnapScrollMode=SNAP_X;
          mSnapPositive=deltaX > 0;
        }
 else         if (ay > MAX_SLOPE_FOR_DIAG * ax) {
          mSnapScrollMode=SNAP_Y;
          mSnapPositive=deltaY > 0;
        }
      }
      mTouchMode=TOUCH_DRAG_MODE;
      mLastTouchX=x;
      mLastTouchY=y;
      fDeltaX=0.0f;
      fDeltaY=0.0f;
      deltaX=0;
      deltaY=0;
      startDrag();
    }
    if (mDragTrackerHandler != null) {
      mDragTrackerHandler.dragTo(x,y);
    }
    boolean done=false;
    boolean keepScrollBarsVisible=false;
    if (Math.abs(fDeltaX) < 1.0f && Math.abs(fDeltaY) < 1.0f) {
      mLastTouchX=x;
      mLastTouchY=y;
      keepScrollBarsVisible=done=true;
    }
 else {
      if (mSnapScrollMode == SNAP_X || mSnapScrollMode == SNAP_Y) {
        int ax=Math.abs(deltaX);
        int ay=Math.abs(deltaY);
        if (mSnapScrollMode == SNAP_X) {
          if (ay > MAX_SLOPE_FOR_DIAG * ax && ay > MIN_BREAK_SNAP_CROSS_DISTANCE) {
            mSnapScrollMode=SNAP_NONE;
          }
          if (ax > MAX_SLOPE_FOR_DIAG * ay && (mSnapPositive ? deltaX < -mMinLockSnapReverseDistance : deltaX > mMinLockSnapReverseDistance)) {
            mSnapScrollMode|=SNAP_LOCK;
          }
        }
 else {
          if (ax > MAX_SLOPE_FOR_DIAG * ay && ax > MIN_BREAK_SNAP_CROSS_DISTANCE) {
            mSnapScrollMode=SNAP_NONE;
          }
          if (ay > MAX_SLOPE_FOR_DIAG * ax && (mSnapPositive ? deltaY < -mMinLockSnapReverseDistance : deltaY > mMinLockSnapReverseDistance)) {
            mSnapScrollMode|=SNAP_LOCK;
          }
        }
      }
      if (mSnapScrollMode != SNAP_NONE) {
        if ((mSnapScrollMode & SNAP_X) == SNAP_X) {
          deltaY=0;
        }
 else {
          deltaX=0;
        }
      }
      if ((deltaX | deltaY) != 0) {
        if (deltaX != 0) {
          mLastTouchX=x;
        }
        if (deltaY != 0) {
          mLastTouchY=y;
        }
        mHeldMotionless=MOTIONLESS_FALSE;
      }
 else {
        mLastTouchX=x;
        mLastTouchY=y;
        keepScrollBarsVisible=true;
      }
      mLastTouchTime=eventTime;
      mUserScroll=true;
    }
    doDrag(deltaX,deltaY);
    if (keepScrollBarsVisible) {
      if (mHeldMotionless != MOTIONLESS_TRUE) {
        mHeldMotionless=MOTIONLESS_TRUE;
        invalidate();
      }
      awakenScrollBars(ViewConfiguration.getScrollDefaultDelay(),false);
      return !done;
    }
    break;
  }
case MotionEvent.ACTION_UP:
{
  if (shouldForwardTouchEvent()) {
    TouchEventData ted=new TouchEventData();
    ted.mAction=action;
    ted.mX=contentX;
    ted.mY=contentY;
    ted.mMetaState=ev.getMetaState();
    ted.mReprocess=mDeferTouchProcess;
    if (mDeferTouchProcess) {
      ted.mViewX=x;
      ted.mViewY=y;
    }
    mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
  }
  mLastTouchUpTime=eventTime;
switch (mTouchMode) {
case TOUCH_DOUBLE_TAP_MODE:
    mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
  mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
if (inFullScreenMode() || mDeferTouchProcess) {
  TouchEventData ted=new TouchEventData();
  ted.mAction=WebViewCore.ACTION_DOUBLETAP;
  ted.mX=contentX;
  ted.mY=contentY;
  ted.mMetaState=ev.getMetaState();
  ted.mReprocess=mDeferTouchProcess;
  if (mDeferTouchProcess) {
    ted.mViewX=x;
    ted.mViewY=y;
  }
  mWebViewCore.sendMessage(EventHub.TOUCH_EVENT,ted);
}
 else if (mPreventDefault != PREVENT_DEFAULT_YES) {
  doDoubleTap();
  mTouchMode=TOUCH_DONE_MODE;
}
break;
case TOUCH_INIT_MODE:
case TOUCH_SHORTPRESS_START_MODE:
case TOUCH_SHORTPRESS_MODE:
mPrivateHandler.removeMessages(SWITCH_TO_SHORTPRESS);
mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS);
if (mConfirmMove) {
Log.w(LOGTAG,"String_Node_Str" + "String_Node_Str");
if (mPreventDefault != PREVENT_DEFAULT_YES && (computeMaxScrollX() > 0 || computeMaxScrollY() > 0)) {
cancelWebCoreTouchEvent(contentX,contentY,true);
WebViewCore.reducePriority();
WebViewCore.pauseUpdatePicture(mWebViewCore);
}
 else {
invalidate();
break;
}
}
 else {
if (mSelectingText) {
if (nativeHitSelection(contentX,contentY)) {
copySelection();
}
selectionDone();
break;
}
if (mTouchMode == TOUCH_INIT_MODE) {
mPrivateHandler.sendEmptyMessageDelayed(RELEASE_SINGLE_TAP,ViewConfiguration.getDoubleTapTimeout());
}
 else {
doShortPress();
}
break;
}
case TOUCH_DRAG_MODE:
mPrivateHandler.removeMessages(DRAG_HELD_MOTIONLESS);
mPrivateHandler.removeMessages(AWAKEN_SCROLL_BARS);
if (eventTime - mLastTouchTime <= MIN_FLING_TIME) {
if (mVelocityTracker == null) {
Log.e(LOGTAG,"String_Node_Str" + "String_Node_Str" + mPreventDefault + "String_Node_Str"+ mDeferTouchProcess);
}
mVelocityTracker.addMovement(ev);
mHeldMotionless=MOTIONLESS_IGNORE;
doFling();
break;
}
 else {
if (mScroller.springBack(mScrollX,mScrollY,0,computeMaxScrollX(),0,computeMaxScrollY())) {
invalidate();
}
}
mHeldMotionless=MOTIONLESS_TRUE;
invalidate();
case TOUCH_DRAG_START_MODE:
mLastVelocity=0;
WebViewCore.resumePriority();
WebViewCore.resumeUpdatePicture(mWebViewCore);
break;
}
stopTouch();
break;
}
case MotionEvent.ACTION_CANCEL:
{
if (mTouchMode == TOUCH_DRAG_MODE) {
mScroller.springBack(mScrollX,mScrollY,0,computeMaxScrollX(),0,computeMaxScrollY());
invalidate();
}
cancelWebCoreTouchEvent(contentX,contentY,false);
cancelTouch();
break;
}
}
return true;
}