diff options
| author | John Reck <jreck@google.com> | 2012-02-28 11:40:00 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-02-28 11:40:00 -0800 |
| commit | 42fb45588f9fc469a9217c06ef0241b3de657922 (patch) | |
| tree | 2014033b60709a7708ab74c3c27e986ac14ab4a8 /core/java/android/webkit/WebView.java | |
| parent | c2baeffe00b9dee515fdd3c39e9a7bc910ea2346 (diff) | |
| parent | 5528d7ccd1a02798af076ff07717f1f2dab4e11a (diff) | |
Merge "Fix cursorRingBounds NPE"
Diffstat (limited to 'core/java/android/webkit/WebView.java')
| -rw-r--r-- | core/java/android/webkit/WebView.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 570b4a82e639..424dd6dfd90e 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3144,7 +3144,7 @@ public class WebView extends AbsoluteLayout return; } if (nativeHasCursorNode()) { - Rect cursorBounds = nativeGetCursorRingBounds(); + Rect cursorBounds = cursorRingBounds(); if (!cursorBounds.contains(contentX, contentY)) { int slop = viewToContentDimension(mNavSlop); cursorBounds.inset(-slop, -slop); @@ -7545,7 +7545,7 @@ public class WebView extends AbsoluteLayout return false; } if (time - mLastCursorTime <= TRACKBALL_TIMEOUT - && !mLastCursorBounds.equals(nativeGetCursorRingBounds())) { + && !mLastCursorBounds.equals(cursorRingBounds())) { nativeSelectBestAt(mLastCursorBounds); } if (DebugFlags.WEB_VIEW) { @@ -10125,7 +10125,7 @@ public class WebView extends AbsoluteLayout } mInitialHitTestResult = null; mLastCursorTime = time; - mLastCursorBounds = nativeGetCursorRingBounds(); + mLastCursorBounds = cursorRingBounds(); boolean keyHandled = nativeMoveCursor(keyCode, count, noScroll) == false; if (DebugFlags.WEB_VIEW) { @@ -10136,7 +10136,7 @@ public class WebView extends AbsoluteLayout if (keyHandled == false) { return keyHandled; } - Rect contentCursorRingBounds = nativeGetCursorRingBounds(); + Rect contentCursorRingBounds = cursorRingBounds(); if (contentCursorRingBounds.isEmpty()) return keyHandled; Rect viewCursorRingBounds = contentToViewRect(contentCursorRingBounds); // set last touch so that context menu related functions will work @@ -10350,6 +10350,14 @@ public class WebView extends AbsoluteLayout return isEditable; } + // TODO: Remove this + Rect cursorRingBounds() { + if (sDisableNavcache) { + return new Rect(); + } + return nativeGetCursorRingBounds(); + } + private native int nativeCacheHitFramePointer(); private native boolean nativeCacheHitIsPlugin(); private native Rect nativeCacheHitNodeBounds(); |
