diff options
author | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 23:30:11 +0000 |
---|---|---|
committer | sidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-11 23:30:11 +0000 |
commit | 6d886b7494b96793a07fd8974b895102c51ad57e (patch) | |
tree | a7e5f6b11626de0a8dd3205c4338345268f42dcc | |
parent | f30815b6a004410c2ce7452ca929b773d6d56190 (diff) | |
download | chromium_src-6d886b7494b96793a07fd8974b895102c51ad57e.zip chromium_src-6d886b7494b96793a07fd8974b895102c51ad57e.tar.gz chromium_src-6d886b7494b96793a07fd8974b895102c51ad57e.tar.bz2 |
Fix bug where right click in a text area selects empty space.
Issue=6107
Review URL: http://codereview.chromium.org/20280
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9613 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/context_menu_client_impl.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/webkit/glue/context_menu_client_impl.cc b/webkit/glue/context_menu_client_impl.cc index 2d7a074..dea8840 100644 --- a/webkit/glue/context_menu_client_impl.cc +++ b/webkit/glue/context_menu_client_impl.cc @@ -92,7 +92,14 @@ std::wstring GetMisspelledWord(const WebCore::ContextMenu* default_menu, misspelled_word_string = CollapseWhitespace( webkit_glue::StringToStdWString(selected_frame->selectedText()), false); - + + // If misspelled word is empty, then that portion should not be selected. + // Set the selection to that position only, and do not expand. + if (misspelled_word_string.empty()) { + selection = WebCore::Selection(pos); + selected_frame->selection()->setSelection(selection); + } + return misspelled_word_string; } |