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
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 @@
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;
}