From 6d886b7494b96793a07fd8974b895102c51ad57e Mon Sep 17 00:00:00 2001 From: "sidchat@google.com" Date: Wed, 11 Feb 2009 23:30:11 +0000 Subject: 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 --- webkit/glue/context_menu_client_impl.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; } -- cgit v1.1