Loading core/java/android/webkit/WebTextView.java +12 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,18 @@ import junit.framework.Assert; return false; } void ensureLayout() { if (getLayout() == null) { // Ensure we have a Layout measure(mWidthSpec, mHeightSpec); LayoutParams params = (LayoutParams) getLayoutParams(); if (params != null) { layout(params.x, params.y, params.x + params.width, params.y + params.height); } } } /** * Determine whether this WebTextView currently represents the node * represented by ptr. Loading core/java/android/webkit/WebView.java +12 −0 Original line number Diff line number Diff line Loading @@ -3750,6 +3750,18 @@ public class WebView extends AbsoluteLayout clearTextEntry(); } if (inEditingMode()) { // Since we just called rebuildWebTextView, the layout is not set // properly. Update it so it can correctly find the word to select. mWebTextView.ensureLayout(); // Provide a touch down event to WebTextView, which will allow it // to store the location to use in performLongClick. AbsoluteLayout.LayoutParams params = (AbsoluteLayout.LayoutParams) mWebTextView.getLayoutParams(); MotionEvent fake = MotionEvent.obtain(mLastTouchTime, mLastTouchTime, MotionEvent.ACTION_DOWN, mLastTouchX - params.x + mScrollX, mLastTouchY - params.y + mScrollY, 0); mWebTextView.dispatchTouchEvent(fake); return mWebTextView.performLongClick(); } if (mSelectingText) return false; // long click does nothing on selection Loading Loading
core/java/android/webkit/WebTextView.java +12 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,18 @@ import junit.framework.Assert; return false; } void ensureLayout() { if (getLayout() == null) { // Ensure we have a Layout measure(mWidthSpec, mHeightSpec); LayoutParams params = (LayoutParams) getLayoutParams(); if (params != null) { layout(params.x, params.y, params.x + params.width, params.y + params.height); } } } /** * Determine whether this WebTextView currently represents the node * represented by ptr. Loading
core/java/android/webkit/WebView.java +12 −0 Original line number Diff line number Diff line Loading @@ -3750,6 +3750,18 @@ public class WebView extends AbsoluteLayout clearTextEntry(); } if (inEditingMode()) { // Since we just called rebuildWebTextView, the layout is not set // properly. Update it so it can correctly find the word to select. mWebTextView.ensureLayout(); // Provide a touch down event to WebTextView, which will allow it // to store the location to use in performLongClick. AbsoluteLayout.LayoutParams params = (AbsoluteLayout.LayoutParams) mWebTextView.getLayoutParams(); MotionEvent fake = MotionEvent.obtain(mLastTouchTime, mLastTouchTime, MotionEvent.ACTION_DOWN, mLastTouchX - params.x + mScrollX, mLastTouchY - params.y + mScrollY, 0); mWebTextView.dispatchTouchEvent(fake); return mWebTextView.performLongClick(); } if (mSelectingText) return false; // long click does nothing on selection Loading