Editor class has two different code paths for spell-checking: One is for (A) using checkSpellingOfString() and checkGrammarOfString(), another is for (B) using checkTextOfParagraph(), the unified text checker available for Mac OS SL or later. Having this completely different code paths makes it hard to modify spellchecking code. We could eliminate "A" by providing checkTextOfParagraph() equivalent which only uses checkSpellingOfString() and checkGrammarOfString(). This emulation doesn't need to be perfect because current "A" behavior is subset of "B" anyway. Such change would hugely simplify spellchecking code.
Created attachment 103228 [details] WIP
Comment on attachment 103228 [details] WIP Attachment 103228 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/9329784
Comment on attachment 103228 [details] WIP Attachment 103228 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/9323976
Comment on attachment 103228 [details] WIP Attachment 103228 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/9325949
Comment on attachment 103228 [details] WIP Attachment 103228 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9328806 New failing tests: editing/pasteboard/merge-end-blockquote.html editing/deleting/delete-block-contents-003.html editing/pasteboard/merge-after-delete-2.html editing/pasteboard/merge-after-delete.html editing/pasteboard/merge-end-table.html editing/spelling/spelling-backspace-between-lines.html editing/selection/5234383-1.html editing/deleting/delete-ws-fixup-002.html editing/pasteboard/merge-end-list.html editing/selection/5234383-2.html editing/inserting/insert-div-016.html editing/selection/move-backwords-by-word-001.html editing/pasteboard/merge-after-delete-1.html editing/spelling/spelling-attribute-change.html editing/inserting/insert-div-018.html editing/spelling/inline_spelling_markers.html editing/selection/13804.html editing/spelling/spelling-linebreak.html editing/spelling/spelling.html editing/deleting/delete-ws-fixup-001.html
Comment on attachment 103228 [details] WIP Attachment 103228 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/9331131
Created attachment 104787 [details] Patch
Comment on attachment 104787 [details] Patch Attachment 104787 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/9482033
Comment on attachment 104787 [details] Patch Attachment 104787 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/9481083
Comment on attachment 104787 [details] Patch Attachment 104787 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/9482036
Created attachment 104789 [details] Patch
Comment on attachment 104789 [details] Patch Attachment 104789 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/9475235
Comment on attachment 104789 [details] Patch Attachment 104789 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/9477148
Created attachment 104793 [details] Patch
It's almost green and ready to review! This change looks large at a glance. But it's almost about removing the redundant code. What essentially new is TextCheckingHelper::checkTextOfParagraph().