On Linux, should be able to get spelling suggestions without selecting the misspelled...
authorg.czajkowski@samsung.com <g.czajkowski@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2013 07:54:11 +0000 (07:54 +0000)
committerg.czajkowski@samsung.com <g.czajkowski@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2013 07:54:11 +0000 (07:54 +0000)
commit6a02945c9b41c90b1a7714ae8c09e5f8178e81d0
tree526c8e5d33a6874339a06892f7bf46f560244a7e
parent2e335045ed6884c8538cdf1d33327c14f15bd858
On Linux, should be able to get spelling suggestions without selecting the misspelled word
https://bugs.webkit.org/show_bug.cgi?id=103520

Reviewed by Ryosuke Niwa.

Source/WebCore:

Allow to get/insert spelling suggestions without selecting the misspelled word for
Linux WebKit ports. WebCore assumes that the misspelled word has to be selected
to get its suggestions.

In compliance with native application behaviour a new editing policy is introduced,
to do not highlight the misspelled word to just get its guesses.

No new tests, covered by context-menu-suggestions.html.

* WebCore.exp.in:
Remove _ZN7WebCore6Editor21isSelectionMisspelledEv symbol as Mac port doesn't
need it any longer.

* editing/EditingBehavior.h:
(EditingBehavior):
(WebCore::EditingBehavior::shouldAllowSpellingSuggestionsWithoutSelection):
Add a new behavior for Linux, to allow spelling suggestions without selecting
the misspelled word.

* editing/Editor.cpp:
(WebCore::Editor::isContinuousSpellCheckingEnabled):
Add missing const modifier, to use this method in 'misspelledWordAtCaretOrRange() const'.

(WebCore::Editor::misspelledWordAtCaretOrRange):
Allow to check spelling under the caret or selected word.
Does nothing for selection made on the multiple words.

(WebCore::Editor::misspelledSelectionString):
Return the misspelled selection.

(WebCore::Editor::guessesForMisspelledWord):
Remove 'Selection' from method name as it may return guesses without selection.

(WebCore::Editor::guessesForMisspelledOrUngrammatical):
Ditto.

* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
Select the word under caret to meet the conditions from misspelledWordAtCaretOrRange.

(WebCore::ContextMenuController::populate):
Update guessesForMisspelledOrUngrammatical call.

LayoutTests:

* platform/efl/TestExpectations:
Unskip context-menu-suggestions.html for WebKit-EFL as it passes now.

* platform/gtk/TestExpectations:
Update failing reason.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139412 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/editing/EditingBehavior.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/page/ContextMenuController.cpp