summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-10-28 17:52:13 -0400
committerLeon Scroggins <scroggo@google.com>2009-10-28 17:52:13 -0400
commit5d9ec169071328031c8d6ece2852a32ba68dc59c (patch)
treeb099b8a3076a0c9d1d381863417c010407a30d02
parent19194ea29920c2f7a02d08dfb0416608bc81dbb7 (diff)
downloadexternal_webkit-5d9ec169071328031c8d6ece2852a32ba68dc59c.zip
external_webkit-5d9ec169071328031c8d6ece2852a32ba68dc59c.tar.gz
external_webkit-5d9ec169071328031c8d6ece2852a32ba68dc59c.tar.bz2
Pass PlatformKeyboardEvents for deletions.
Instead of using TypingCommand::deleteSelection, use events so the javascript events happen, allowing autocomplete fields to work properly. Fixes http://b/issue?id=2059795
-rw-r--r--WebKit/android/jni/WebViewCore.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index c574d5a..f958477 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1670,7 +1670,16 @@ void WebViewCore::deleteSelection(int start, int end, int textGeneration)
WebCore::Node* focus = currentFocus();
if (!focus)
return;
- WebCore::TypingCommand::deleteSelection(focus->document());
+ // Prevent our editor client from passing a message to change the
+ // selection.
+ EditorClientAndroid* client = static_cast<EditorClientAndroid*>(
+ m_mainFrame->editor()->client());
+ client->setUiGeneratedSelectionChange(true);
+ PlatformKeyboardEvent down(kKeyCodeDel, 0, 0, true, false, false, false);
+ PlatformKeyboardEvent up(kKeyCodeDel, 0, 0, false, false, false, false);
+ key(down);
+ key(up);
+ client->setUiGeneratedSelectionChange(false);
m_textGeneration = textGeneration;
}