RESOLVED FIXED 69242
Unified spell-checking and legacy spell checking should be easy to switch
https://bugs.webkit.org/show_bug.cgi?id=69242
Summary Unified spell-checking and legacy spell checking should be easy to switch
Shinya Kawanaka
Reported 2011-10-02 22:53:13 PDT
Editor class has two difference code paths for spell-checking: (1) checkTextOfParagraph() for Snow Leopard or later (2) checkSpellingOfString() and checkGrammarOfString() for other platforms. These paths should be unified so that improving spell-checking code is easy. After 69241 is resolved, static #if-statement USE(UNIFIED_TEXT_CHECKING) in WebCore should be converted to dynamic if-statement so that using checkTextOfParagraph() becomes easy in non-SL or non-Lion platform.
Attachments
Test Patch (35.36 KB, patch)
2011-10-11 02:46 PDT, Shinya Kawanaka
no flags
Patch (38.86 KB, patch)
2011-10-12 03:56 PDT, Shinya Kawanaka
no flags
Patch (34.00 KB, patch)
2011-10-17 04:28 PDT, Shinya Kawanaka
no flags
Patch (35.43 KB, patch)
2011-10-17 05:42 PDT, Shinya Kawanaka
no flags
Shinya Kawanaka
Comment 1 2011-10-11 02:46:41 PDT
Created attachment 110490 [details] Test Patch
WebKit Review Bot
Comment 2 2011-10-11 02:49:24 PDT
Attachment 110490 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/CMakeLists.txt', u'Source/W..." exit_code: 1 Source/WebCore/editing/TextCheckingHelper.h:99: The parameter name "frame" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Shinya Kawanaka
Comment 3 2011-10-12 03:56:51 PDT
Hajime Morrita
Comment 4 2011-10-16 22:02:01 PDT
Comment on attachment 110661 [details] Patch Hi, Thanks for doing this! WebKit generally prefers early-return style instead of if-else. In this case, it also helps to keep diff small.
Shinya Kawanaka
Comment 5 2011-10-17 04:28:42 PDT
Shinya Kawanaka
Comment 6 2011-10-17 04:29:46 PDT
(In reply to comment #4) > (From update of attachment 110661 [details]) > Hi, Thanks for doing this! > WebKit generally prefers early-return style instead of if-else. > In this case, it also helps to keep diff small. Hi, I tried to keep early-return style as much as possible. If not enough, please tell me...
Hajime Morrita
Comment 7 2011-10-17 04:47:35 PDT
Comment on attachment 111242 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=111242&action=review Generally looks fine. Could you take these small cleanup? > Source/WebCore/editing/Editor.cpp:1682 > + if (unifiedTextCheckerEnabled(m_frame)) { Could you wrap this conditional as a Editor method? > Source/WebCore/editing/Editor.cpp:2040 > + } Why not simply ASSERT(unifiedTextCheckerEnabled(m_frame)) ? > Source/WebCore/editing/Editor.cpp:2239 > + } Ditto. > Source/WebCore/editing/TextCheckingHelper.cpp:230 > + if (!m_range || !unifiedTextCheckerEnabled(m_range->ownerDocument()->frame())) Could you extract this criteria as a method of TextCheckingHelper? > Source/WebCore/editing/TextCheckingHelper.cpp:509 > + if (!m_range || !unifiedTextCheckerEnabled(m_range->ownerDocument()->frame())) Ditto. > Source/WebCore/editing/TextCheckingHelper.h:30 > +class Settings; It looks we don't need this.
Shinya Kawanaka
Comment 8 2011-10-17 05:42:14 PDT
WebKit Review Bot
Comment 9 2011-10-17 05:46:00 PDT
Attachment 111251 [details] did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit', '--chromium']" exit_code: 2 Updating OpenSource Current branch master is up to date. Updating chromium port dependencies using gclient... Error: Can't switch the checkout to http://v8.googlecode.com/svn/branches/3.6@9637; UUID don't match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again. Re-trying 'depot_tools/gclient sync' Error: Can't switch the checkout to http://v8.googlecode.com/svn/branches/3.6@9637; UUID don't match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again. Re-trying 'depot_tools/gclient sync' Error: Can't switch the checkout to http://v8.googlecode.com/svn/branches/3.6@9637; UUID don't match and there is local changes in /mnt/git/webkit-style-queue/Source/WebKit/chromium/v8. Delete the directory and try again. Error: 'depot_tools/gclient sync' failed 3 tries and returned 256 at Tools/Scripts/update-webkit-chromium line 107. Re-trying 'depot_tools/gclient sync' No such file or directory at Tools/Scripts/update-webkit line 104. If any of these errors are false positives, please file a bug against check-webkit-style.
Hajime Morrita
Comment 10 2011-10-17 18:02:00 PDT
Comment on attachment 111251 [details] Patch r+ed. And cq+ing.
WebKit Review Bot
Comment 11 2011-10-17 18:37:56 PDT
Comment on attachment 111251 [details] Patch Clearing flags on attachment: 111251 Committed r97696: <http://trac.webkit.org/changeset/97696>
WebKit Review Bot
Comment 12 2011-10-17 18:38:01 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.