summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/WebView.java
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-03-17 15:58:20 -0400
committerCary Clark <cary@android.com>2010-03-18 08:46:41 -0400
commite84a0db030ac95deb74e59864ff65516a243d3b8 (patch)
tree3de45fbc129d4f03aeb558726e783f11b15f769b /core/java/android/webkit/WebView.java
parent26aa68c6a234598de35f1a8af3c3c7abe8247d1d (diff)
simplify utility to hit-test focused plugin
After about 4 taps, this starts to return that the tap was in the plugin. Before that, the plugin doesn't have focus. Derek may want to verify that everything is working as it should -- maybe it just takes that long for webkit to take focus. companion fix in external/webkit Change-Id: I80ffba6c55876b0af9c305c539a10e8e8ed7cb3c http://b/2521087
Diffstat (limited to 'core/java/android/webkit/WebView.java')
-rw-r--r--core/java/android/webkit/WebView.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 39b87fee49f2..418dc9c9cdac 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -4521,9 +4521,14 @@ public class WebView extends AbsoluteLayout
}
private boolean hitFocusedPlugin(int contentX, int contentY) {
+ if (DebugFlags.WEB_VIEW) {
+ Log.v(LOGTAG, "nativeFocusIsPlugin()=" + nativeFocusIsPlugin());
+ Rect r = nativeFocusNodeBounds();
+ Log.v(LOGTAG, "nativeFocusNodeBounds()=(" + r.left + ", " + r.top
+ + ", " + r.right + ", " + r.bottom + ")");
+ }
return nativeFocusIsPlugin()
- && nativePointInNavCache(contentX, contentY, mNavSlop)
- && nativeCacheHitNodePointer() == nativeFocusNodePointer();
+ && nativeFocusNodeBounds().contains(contentX, contentY);
}
private boolean shouldForwardTouchEvent() {
@@ -7169,6 +7174,7 @@ public class WebView extends AbsoluteLayout
*/
private native int nativeFocusCandidateType();
private native boolean nativeFocusIsPlugin();
+ private native Rect nativeFocusNodeBounds();
/* package */ native int nativeFocusNodePointer();
private native Rect nativeGetCursorRingBounds();
private native String nativeGetSelection();