Title: [125757] trunk/Source/WebKit/chromium
Revision
125757
Author
[email protected]
Date
2012-08-16 01:07:51 -0700 (Thu, 16 Aug 2012)

Log Message

Prevent showing suggestions when right-clicking a selection range.
https://bugs.webkit.org/show_bug.cgi?id=94189

Reviewed by Hajime Morita.

To emulate Safari, my r120810 changes selection when right-clicking a misspelled
word. Unfortunately, this change somehow uses VisibleSelection::isCaretOrRange
and it changes the existing selection when right-clicking a selection which
includes a misspelled word. This change uses VisibleSelection::isCaret to
prevent showing suggestions when right-clicking a selection range. (Neither does
Safari show suggestions when there is a selection range.)

* src/ContextMenuClientImpl.cpp:
(WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (125756 => 125757)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-16 07:57:39 UTC (rev 125756)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-16 08:07:51 UTC (rev 125757)
@@ -1,3 +1,20 @@
+2012-08-16  Hironori Bono  <[email protected]>
+
+        Prevent showing suggestions when right-clicking a selection range.
+        https://bugs.webkit.org/show_bug.cgi?id=94189
+
+        Reviewed by Hajime Morita.
+
+        To emulate Safari, my r120810 changes selection when right-clicking a misspelled
+        word. Unfortunately, this change somehow uses VisibleSelection::isCaretOrRange
+        and it changes the existing selection when right-clicking a selection which
+        includes a misspelled word. This change uses VisibleSelection::isCaret to
+        prevent showing suggestions when right-clicking a selection range. (Neither does
+        Safari show suggestions when there is a selection range.)
+
+        * src/ContextMenuClientImpl.cpp:
+        (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+
 2012-08-15  Sheriff Bot  <[email protected]>
 
         Unreviewed.  Rolled DEPS.

Modified: trunk/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp (125756 => 125757)


--- trunk/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp	2012-08-16 07:57:39 UTC (rev 125756)
+++ trunk/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp	2012-08-16 08:07:51 UTC (rev 125757)
@@ -279,9 +279,8 @@
         // a mouse on a word, Chrome just needs to find a spelling marker on the word instread of spellchecking it.
         if (selectedFrame->settings() && selectedFrame->settings()->asynchronousSpellCheckingEnabled()) {
             VisibleSelection selection = selectedFrame->selection()->selection();
-            if (selection.isCaretOrRange()) {
-                if (selection.isCaret())
-                    selection.expandUsingGranularity(WordGranularity);
+            if (selection.isCaret()) {
+                selection.expandUsingGranularity(WordGranularity);
                 RefPtr<Range> range = selection.toNormalizedRange();
                 Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->markersInRange(range.get(), DocumentMarker::Spelling | DocumentMarker::Grammar);
                 if (markers.size() == 1) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to