Loading core/java/android/webkit/WebViewClassic.java +16 −15 Original line number Diff line number Diff line Loading @@ -5159,18 +5159,11 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc } private void updateWebkitSelection() { int[] handles = null; if (mIsCaretSelection) { mSelectCursorExtent.set(mSelectCursorBase.x, mSelectCursorBase.y); } if (mSelectingText) { handles = new int[4]; getSelectionHandles(handles); } else { nativeSetTextSelection(mNativeClass, 0); } int handleId = (mSelectDraggingCursor == mSelectCursorBase) ? HANDLE_ID_BASE : HANDLE_ID_EXTENT; mWebViewCore.removeMessages(EventHub.SELECT_TEXT); mWebViewCore.sendMessageAtFrontOfQueue(EventHub.SELECT_TEXT, handles); mWebViewCore.sendMessageAtFrontOfQueue(EventHub.SELECT_TEXT, mSelectDraggingCursor.x, mSelectDraggingCursor.y, (Integer)handleId); } private void resetCaretTimer() { Loading Loading @@ -6104,6 +6097,10 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc } } private static int getSelectionCoordinate(int coordinate, int min, int max) { return Math.max(Math.min(coordinate, max), min); } private void beginScrollEdit() { if (mLastEditScroll == 0) { mLastEditScroll = SystemClock.uptimeMillis() - Loading Loading @@ -6157,11 +6154,15 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc scrollY = Math.min(getMaxTextScrollY(), scrollY); scrollY = Math.max(0, scrollY); scrollEditText(scrollX, scrollY); int cursorX = mSelectDraggingCursor.x; int cursorY = mSelectDraggingCursor.y; mSelectDraggingCursor.set(x - deltaX, y - deltaY); int selectionX = getSelectionCoordinate(x, mEditTextContentBounds.left, mEditTextContentBounds.right); int selectionY = getSelectionCoordinate(y, mEditTextContentBounds.top, mEditTextContentBounds.bottom); int oldX = mSelectDraggingCursor.x; int oldY = mSelectDraggingCursor.y; mSelectDraggingCursor.set(selectionX, selectionY); updateWebkitSelection(); mSelectDraggingCursor.set(cursorX, cursorY); mSelectDraggingCursor.set(oldX, oldY); } } } Loading core/java/android/webkit/WebViewCore.java +4 −8 Original line number Diff line number Diff line Loading @@ -1715,13 +1715,9 @@ public final class WebViewCore { nativeInsertText(mNativeClass, (String) msg.obj); break; case SELECT_TEXT: { int[] args = (int[]) msg.obj; if (args == null) { nativeClearTextSelection(mNativeClass); } else { nativeSelectText(mNativeClass, args[0], args[1], args[2], args[3]); } int handleId = (Integer) msg.obj; nativeSelectText(mNativeClass, handleId, msg.arg1, msg.arg2); break; } case SELECT_WORD_AT: { Loading Loading @@ -3150,7 +3146,7 @@ public final class WebViewCore { private native String nativeGetText(int nativeClass, int startX, int startY, int endX, int endY); private native void nativeSelectText(int nativeClass, int startX, int startY, int endX, int endY); int handleId, int x, int y); private native void nativeClearTextSelection(int nativeClass); private native boolean nativeSelectWordAt(int nativeClass, int x, int y); private native void nativeSelectAll(int nativeClass); Loading Loading
core/java/android/webkit/WebViewClassic.java +16 −15 Original line number Diff line number Diff line Loading @@ -5159,18 +5159,11 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc } private void updateWebkitSelection() { int[] handles = null; if (mIsCaretSelection) { mSelectCursorExtent.set(mSelectCursorBase.x, mSelectCursorBase.y); } if (mSelectingText) { handles = new int[4]; getSelectionHandles(handles); } else { nativeSetTextSelection(mNativeClass, 0); } int handleId = (mSelectDraggingCursor == mSelectCursorBase) ? HANDLE_ID_BASE : HANDLE_ID_EXTENT; mWebViewCore.removeMessages(EventHub.SELECT_TEXT); mWebViewCore.sendMessageAtFrontOfQueue(EventHub.SELECT_TEXT, handles); mWebViewCore.sendMessageAtFrontOfQueue(EventHub.SELECT_TEXT, mSelectDraggingCursor.x, mSelectDraggingCursor.y, (Integer)handleId); } private void resetCaretTimer() { Loading Loading @@ -6104,6 +6097,10 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc } } private static int getSelectionCoordinate(int coordinate, int min, int max) { return Math.max(Math.min(coordinate, max), min); } private void beginScrollEdit() { if (mLastEditScroll == 0) { mLastEditScroll = SystemClock.uptimeMillis() - Loading Loading @@ -6157,11 +6154,15 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc scrollY = Math.min(getMaxTextScrollY(), scrollY); scrollY = Math.max(0, scrollY); scrollEditText(scrollX, scrollY); int cursorX = mSelectDraggingCursor.x; int cursorY = mSelectDraggingCursor.y; mSelectDraggingCursor.set(x - deltaX, y - deltaY); int selectionX = getSelectionCoordinate(x, mEditTextContentBounds.left, mEditTextContentBounds.right); int selectionY = getSelectionCoordinate(y, mEditTextContentBounds.top, mEditTextContentBounds.bottom); int oldX = mSelectDraggingCursor.x; int oldY = mSelectDraggingCursor.y; mSelectDraggingCursor.set(selectionX, selectionY); updateWebkitSelection(); mSelectDraggingCursor.set(cursorX, cursorY); mSelectDraggingCursor.set(oldX, oldY); } } } Loading
core/java/android/webkit/WebViewCore.java +4 −8 Original line number Diff line number Diff line Loading @@ -1715,13 +1715,9 @@ public final class WebViewCore { nativeInsertText(mNativeClass, (String) msg.obj); break; case SELECT_TEXT: { int[] args = (int[]) msg.obj; if (args == null) { nativeClearTextSelection(mNativeClass); } else { nativeSelectText(mNativeClass, args[0], args[1], args[2], args[3]); } int handleId = (Integer) msg.obj; nativeSelectText(mNativeClass, handleId, msg.arg1, msg.arg2); break; } case SELECT_WORD_AT: { Loading Loading @@ -3150,7 +3146,7 @@ public final class WebViewCore { private native String nativeGetText(int nativeClass, int startX, int startY, int endX, int endY); private native void nativeSelectText(int nativeClass, int startX, int startY, int endX, int endY); int handleId, int x, int y); private native void nativeClearTextSelection(int nativeClass); private native boolean nativeSelectWordAt(int nativeClass, int x, int y); private native void nativeSelectAll(int nativeClass); Loading