Title: [118740] trunk/Source/WebKit/chromium
- Revision
- 118740
- Author
- [email protected]
- Date
- 2012-05-29 02:10:41 -0700 (Tue, 29 May 2012)
Log Message
Use WebSpellCheckClient::spellcheck to retrieve suggestions.
https://bugs.webkit.org/show_bug.cgi?id=87690
Reviewed by Hajime Morita.
This change uses WebSpellCheckClient::spellcheck as a fallback method to
retrieve suggestions when a marker does not have any suggestions. (It consumes
lots of CPU power to get suggestions for misspelled word, i.e. Chromium cannot
afford to attach suggestions to all spelling markers.)
* src/ContextMenuClientImpl.cpp:
(WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): Retrieve suggestions if markers do not have any.
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (118739 => 118740)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-05-29 09:06:53 UTC (rev 118739)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-05-29 09:10:41 UTC (rev 118740)
@@ -1,3 +1,18 @@
+2012-05-29 Hironori Bono <[email protected]>
+
+ Use WebSpellCheckClient::spellcheck to retrieve suggestions.
+ https://bugs.webkit.org/show_bug.cgi?id=87690
+
+ Reviewed by Hajime Morita.
+
+ This change uses WebSpellCheckClient::spellcheck as a fallback method to
+ retrieve suggestions when a marker does not have any suggestions. (It consumes
+ lots of CPU power to get suggestions for misspelled word, i.e. Chromium cannot
+ afford to attach suggestions to all spelling markers.)
+
+ * src/ContextMenuClientImpl.cpp:
+ (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): Retrieve suggestions if markers do not have any.
+
2012-05-28 Takashi Toyoshima <[email protected]>
[WebSocket] Receiving reserved close codes, 1005, 1006, and 1015 must appear as code=1006 and wasClean=false
Modified: trunk/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp (118739 => 118740)
--- trunk/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp 2012-05-29 09:06:53 UTC (rev 118739)
+++ trunk/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp 2012-05-29 09:10:41 UTC (rev 118740)
@@ -290,8 +290,13 @@
suggestions.append(descriptions);
}
}
- data.dictionarySuggestions = suggestions;
data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame);
+ if (!suggestions.isEmpty())
+ data.dictionarySuggestions = suggestions;
+ else if (m_webView->spellCheckClient()) {
+ int misspelledOffset, misspelledLength;
+ m_webView->spellCheckClient()->spellCheck(data.misspelledWord, misspelledOffset, misspelledLength, &data.dictionarySuggestions);
+ }
}
}
} else if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes