summaryrefslogtreecommitdiffstats
path: root/webkit/glue/context_menu_client_impl.cc
diff options
context:
space:
mode:
authorsidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 17:10:21 +0000
committersidchat@google.com <sidchat@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 17:10:21 +0000
commit3a500b35925ac17da1f8bf2fb2b9a8c1e5c136ac (patch)
tree6a9c5e3f735c20d81783a6002a0b3ab7689fc293 /webkit/glue/context_menu_client_impl.cc
parent3d329b1ab8d84570bf50fe2e2ba6c8361f4dc3ba (diff)
downloadchromium_src-3a500b35925ac17da1f8bf2fb2b9a8c1e5c136ac.zip
chromium_src-3a500b35925ac17da1f8bf2fb2b9a8c1e5c136ac.tar.gz
chromium_src-3a500b35925ac17da1f8bf2fb2b9a8c1e5c136ac.tar.bz2
Fixes the issue when right clicking on a text in a scrolled text area results in the wrong word being selected. The solution seems to lie in a tricky webkit hack, which requires the use of point() and localPoint() in different situations.
Issue = 613 Review URL: http://codereview.chromium.org/8895 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/context_menu_client_impl.cc')
-rw-r--r--webkit/glue/context_menu_client_impl.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/webkit/glue/context_menu_client_impl.cc b/webkit/glue/context_menu_client_impl.cc
index 37323b0..4e20cbe 100644
--- a/webkit/glue/context_menu_client_impl.cc
+++ b/webkit/glue/context_menu_client_impl.cc
@@ -70,16 +70,11 @@ std::wstring GetMisspelledWord(const WebCore::ContextMenu* default_menu,
!IsASingleWord(misspelled_word_string))
return L"";
- // Expand around the click to see if we clicked a word.
- WebCore::Node* inner_node = default_menu->hitTestResult().innerNode();
- if (inner_node->renderer()->isTextArea()) {
- WebCore::HitTestResult real_result = selected_frame->eventHandler()->
- hitTestResultAtPoint(default_menu->hitTestResult().localPoint(), true);
- inner_node = real_result.innerNode();
- }
-
- WebCore::VisiblePosition pos(inner_node->renderer()->
- positionForPoint(default_menu->hitTestResult().localPoint()));
+ WebCore::HitTestResult hit_test_result = selected_frame->eventHandler()->
+ hitTestResultAtPoint(default_menu->hitTestResult().point(), true);
+ WebCore::Node* inner_node = hit_test_result.innerNode();
+ WebCore::VisiblePosition pos(inner_node->renderer()->positionForPoint(
+ hit_test_result.localPoint()));
WebCore::Selection selection;
if (pos.isNotNull()) {