Title: [126725] branches/chromium/1229/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
Revision
126725
Author
[email protected]
Date
2012-08-26 23:10:48 -0700 (Sun, 26 Aug 2012)

Log Message

Merge 125757 - 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):


[email protected]
Review URL: https://chromiumcodereview.appspot.com/10868101

Modified Paths

Diff

Modified: branches/chromium/1229/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp (126724 => 126725)


--- branches/chromium/1229/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp	2012-08-27 05:55:55 UTC (rev 126724)
+++ branches/chromium/1229/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp	2012-08-27 06:10:48 UTC (rev 126725)
@@ -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