OSDN Git Service

Do not hide the cursor ring when clicking on a <select> element.
authorLeon Scroggins <scroggo@google.com>
Tue, 27 Apr 2010 15:47:28 +0000 (16:47 +0100)
committerLeon Scroggins <scroggo@google.com>
Tue, 27 Apr 2010 15:47:28 +0000 (16:47 +0100)
Add a CachedNodeType for <select> elements.  If the cursor node is
a <select> element, do not call setFollowedLink, which would hide
the cursor ring.

Bug 1694023

Change-Id: I2df2e70391b5f5969683b71b1e69bc24cba8946f

WebKit/android/nav/CacheBuilder.cpp
WebKit/android/nav/CachedNode.h
WebKit/android/nav/CachedNodeType.h
WebKit/android/nav/WebView.cpp

index 7ee2a16..b98b31f 100644 (file)
@@ -1216,6 +1216,8 @@ void CacheBuilder::BuildFrame(Frame* root, Frame* frame,
             if (!href.isEmpty() && !WebCore::protocolIsJavaScript(href.string()))
                 // Set the exported string for all non-javascript anchors.
                 exported = href.string().threadsafeCopy();
+        } else if (node->hasTagName(HTMLNames::selectTag)) {
+            type = SELECT_CACHEDNODETYPE;
         }
         if (type == TEXT_INPUT_CACHEDNODETYPE) {
             RenderTextControl* renderText = 
index f3cfd98..b707ac1 100644 (file)
@@ -118,6 +118,7 @@ public:
         return clip.intersects(bounds(frame));
     }
     bool isPlugin() const { return mType == PLUGIN_CACHEDNODETYPE; }
+    bool isSelect() const { return mType == SELECT_CACHEDNODETYPE; }
     bool isSyntheticLink() const {
         return mType >= ADDRESS_CACHEDNODETYPE && mType <= PHONE_CACHEDNODETYPE;
     }
index 21e2d40..8334b2f 100644 (file)
@@ -37,7 +37,8 @@ enum CachedNodeType {
     AREA_CACHEDNODETYPE,
     FRAME_CACHEDNODETYPE,
     PLUGIN_CACHEDNODETYPE,
-    TEXT_INPUT_CACHEDNODETYPE
+    TEXT_INPUT_CACHEDNODETYPE,
+    SELECT_CACHEDNODETYPE
 };
 
 enum CachedNodeBits {
index bdcafbf..d5c0758 100644 (file)
@@ -882,7 +882,8 @@ bool motionUp(int x, int y, int slop)
     viewInvalidate();
     if (!result->isTextInput()) {
         clearTextEntry();
-        setFollowedLink(true);
+        if (!result->isSelect())
+            setFollowedLink(true);
         if (syntheticLink)
             overrideUrlLoading(result->getExport());
     }
@@ -1634,9 +1635,12 @@ static void nativeSetFindIsEmpty(JNIEnv *env, jobject obj)
 
 static void nativeSetFollowedLink(JNIEnv *env, jobject obj, bool followed)
 {
-    WebView* view = GET_NATIVE_VIEW(env, obj);
-    LOG_ASSERT(view, "view not set in %s", __FUNCTION__);
-    view->setFollowedLink(followed);
+    const CachedNode* cursor = getCursorNode(env, obj);
+    if (cursor && !cursor->isSelect()) {
+        WebView* view = GET_NATIVE_VIEW(env, obj);
+        LOG_ASSERT(view, "view not set in %s", __FUNCTION__);
+        view->setFollowedLink(followed);
+    }
 }
 
 static void nativeSetHeightCanMeasure(JNIEnv *env, jobject obj, bool measure)