Improve dragging on WebTextView.

When the WebTextView scrolls, scroll the corresponding RenderTextControl
in webkit.  Requires a change in frameworks/base.
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 9f457f4..51293b8 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1517,6 +1517,26 @@
     updateTextfield(focus, false, test);
 }
 
+void WebViewCore::scrollFocusedTextInput(int x, int y)
+{
+    WebCore::Node* focus = currentFocus();
+    if (!focus) {
+        DBG_NAV_LOG("!focus");
+        clearTextEntry();
+        return;
+    }
+    WebCore::RenderObject* renderer = focus->renderer();
+    if (!renderer || (!renderer->isTextField() && !renderer->isTextArea())) {
+        DBG_NAV_LOGD("renderer==%p || not text", renderer);
+        clearTextEntry();
+        return;
+    }
+    WebCore::RenderTextControl* renderText =
+        static_cast<WebCore::RenderTextControl*>(renderer);
+    renderText->setScrollLeft(x);
+    renderText->setScrollTop(y);
+}
+
 void WebViewCore::setFocusControllerActive(bool active)
 {
     m_mainFrame->page()->focusController()->setActive(active);
@@ -2180,6 +2200,15 @@
         PlatformKeyboardEvent(keyCode, keyValue, 0, down, cap, fn, sym));
 }
 
+static void ScrollFocusedTextInput(JNIEnv *env, jobject obj, jint x, jint y)
+{
+#ifdef ANDROID_INSTRUMENT
+    TimeCounterAuto counter(TimeCounter::WebViewCoreTimeCounter);
+#endif
+    WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
+    viewImpl->scrollFocusedTextInput(x, y);
+}
+
 static void SetFocusControllerActive(JNIEnv *env, jobject obj, jboolean active)
 {
 #ifdef ANDROID_INSTRUMENT
@@ -2630,7 +2659,9 @@
     { "nativeMoveMouseIfLatest", "(IIII)V",
         (void*) MoveMouseIfLatest },
     { "passToJs", "(ILjava/lang/String;IIZZZZ)V",
-        (void*) PassToJs } ,
+        (void*) PassToJs },
+    { "nativeScrollFocusedTextInput", "(II)V",
+        (void*) ScrollFocusedTextInput },
     { "nativeSetFocusControllerActive", "(Z)V",
         (void*) SetFocusControllerActive },
     { "nativeSaveDocumentState", "(I)V",
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index 66ef470..be08830 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -266,6 +266,10 @@
             int textGeneration);
         void passToJs(int generation,
             const WebCore::String& , const WebCore::PlatformKeyboardEvent& );
+        /**
+         * Scroll the focused textfield to (x, y) in document space
+         */
+        void scrollFocusedTextInput(int x, int y);
         void setFocusControllerActive(bool active);
 
         void saveDocumentState(WebCore::Frame* frame);