Skip to content
  • adele@apple.com's avatar
    Source/WebCore: Fix for <rdar://problem/9112694> REGRESSION (r79411): "Check... · aeeb7f1e
    adele@apple.com authored
    Source/WebCore: Fix for <rdar://problem/9112694> REGRESSION (r79411): "Check grammar with spelling" context menu doesn't check as you type
    https://bugs.webkit.org/show_bug.cgi?id=57173
    
    Reviewed by Eric Seidel.
    
    Test: editing/spelling/grammar.html
    
    * WebCore.exp.in: Add symbol for new selectionStartHasMarkerFor method.
    * editing/Editor.cpp:
    (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Every use of paragraph is specific to spelling or grammar, 
     so to avoid confusion, we should explicitly use spellingParagraph or grammarParagraph.  In the case of this bug, 
     when we're consider ambiguous boundary characters (characters that could indicate word boundaries, but are used 
     in the middle of words too, like apostrophes), we should use the use the spellingParagraph since the spellingParagraph 
     is the only one operated on when this information is used.
     (WebCore::Editor::selectionStartHasMarkerFor): Changed from selectionStartHasSpellingMarkerFor so it can check for grammar as well as spelling.
    * editing/Editor.h:
    
    Source/WebKit/mac: Fix for <rdar://problem/9112694> REGRESSION (r79411): "Check grammar with spelling" context menu doesn't check as you type
    https://bugs.webkit.org/show_bug.cgi?id=57173
    
    Reviewed by Eric Seidel.
    
    * WebView/WebFrame.mm:
    (-[WebFrame hasSpellingMarker:length:]): Call new selectionStartHasMarkerFor method instead of selectionStartHasSpellingMarkerFor.
    (-[WebFrame hasGrammarMarker:length:]): Call new selectionStartHasMarkerFor method.
    * WebView/WebFramePrivate.h: Add hasGrammarMarker so grammar marking can be tested.
    
    Tools: Testing support for <rdar://problem/9112694> REGRESSION (r79411): "Check grammar with spelling" context menu doesn't check as you type
    https://bugs.webkit.org/show_bug.cgi?id=57173
    
    Reviewed by Eric Seidel.
    
    * DumpRenderTree/LayoutTestController.cpp:
    (hasGrammarMarkerCallback): Added.
    (LayoutTestController::staticFunctions): Added case for hasGrammarMarker.
    * DumpRenderTree/LayoutTestController.h:
    * DumpRenderTree/mac/DumpRenderTree.mm: (createWebViewAndOffscreenWindow): Call setGrammarCheckingEnabled.
    * DumpRenderTree/mac/LayoutTestControllerMac.mm: (LayoutTestController::hasGrammarMarker): Added. Call new hasGrammarMarker method.
    
    LayoutTests: Test for <rdar://problem/9112694> REGRESSION (r79411): "Check grammar with spelling" context menu doesn't check as you type
    https://bugs.webkit.org/show_bug.cgi?id=57173
    
    Reviewed by Eric Seidel.
    
    * editing/spelling/grammar-expected.txt: Added.
    * editing/spelling/grammar.html: Added.
    * platform/gtk/Skipped:
    * platform/mac-wk2/Skipped:
    * platform/qt/Skipped:
    * platform/win/Skipped:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    aeeb7f1e