summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Brenner <russellbrenner@google.com>2011-06-10 10:58:48 -0700
committerRussell Brenner <russellbrenner@google.com>2011-06-13 11:07:46 -0700
commitbaaa907099a858a7d17131e26ff4c75bacc75f26 (patch)
tree7fd280ccdd6d6ce284015c34bdd9afc32a5961fd
parent12b73c856f825f0819e61834cb0bc76353b261d4 (diff)
downloadexternal_webkit-baaa907099a858a7d17131e26ff4c75bacc75f26.zip
external_webkit-baaa907099a858a7d17131e26ff4c75bacc75f26.tar.gz
external_webkit-baaa907099a858a7d17131e26ff4c75bacc75f26.tar.bz2
Add javascript 'select' event
The jni code uses lower-level apis for controlling text selections that are hard-wired as non-user actions. This change adds an additional call from the jni code to signal that the selection changed due to user action. Bug: 4444489 Change-Id: I5a637ad9826455e21d43d1e28476b1c814cb65f7
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index a2db69d..b0600ed 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -2117,6 +2117,12 @@ void WebViewCore::setSelection(int start, int end)
m_mainFrame->editor()->client());
client->setUiGeneratedSelectionChange(true);
setSelectionRange(focus, start, end);
+ if (start != end) {
+ // Fire a select event. No event is sent when the selection reduces to
+ // an insertion point
+ RenderTextControl* control = toRenderTextControl(renderer);
+ control->selectionChanged(true);
+ }
client->setUiGeneratedSelectionChange(false);
WebCore::Frame* focusedFrame = focus->document()->frame();
bool isPasswordField = false;