Skip to content
  • g.czajkowski@samsung.com's avatar
    On Linux, should be able to get spelling suggestions without selecting the misspelled word · 0303b043
    g.czajkowski@samsung.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@139412 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    0303b043