"Check Grammar With Spelling" and "Ignore Grammar" shouldn't be populated in the context menu when GRAMMAR_CHECKING is off. "Spelling and Grammar" should be replaced with "Spelling" as the sub menu title and "Show/Hide Spelling and Grammar" with "Show/Hide Spelling" when GRAMMAR_CHECKING is off.
Created attachment 204560 [details] guard grammar checking in context menu code
Comment on attachment 204560 [details] guard grammar checking in context menu code View in context: https://bugs.webkit.org/attachment.cgi?id=204560&action=review > Source/WebCore/platform/LocalizedStrings.cpp:304 > if (show) > +#if USE(GRAMMAR_CHECKING) > return WEB_UI_STRING("Show Spelling and Grammar", "menu item title"); > return WEB_UI_STRING("Hide Spelling and Grammar", "menu item title"); > +#else > + return WEB_UI_STRING("Show Spelling", "menu item title"); > + return WEB_UI_STRING("Hide Spelling", "menu item title"); > +#endif I'd rather if (show) was duplicated here, once in the #if block and once in the #else block.
(In reply to comment #2) > (From update of attachment 204560 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=204560&action=review > > > Source/WebCore/platform/LocalizedStrings.cpp:304 > > if (show) > > +#if USE(GRAMMAR_CHECKING) > > return WEB_UI_STRING("Show Spelling and Grammar", "menu item title"); > > return WEB_UI_STRING("Hide Spelling and Grammar", "menu item title"); > > +#else > > + return WEB_UI_STRING("Show Spelling", "menu item title"); > > + return WEB_UI_STRING("Hide Spelling", "menu item title"); > > +#endif > > I'd rather if (show) was duplicated here, once in the #if block and once in the #else block. OK, fixed.
Committed r151632: <http://trac.webkit.org/changeset/151632>
In Qt Debug build bots both x32 and x64 there is a compilation error : stdio log: /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/Source/WebCore/editing/Editor.cpp: In member function 'void WebCore::Editor::advanceToNextMisspelling(bool)': /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/Source/WebCore/editing/Editor.cpp:1771:12: error: 'WTF_USE_GRAMMAR_CHECKING' was not declared in this scope /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/Source/WebCore/editing/Editor.cpp: In member function 'void WebCore::Editor::markMisspellingsOrBadGrammar(const WebCore::VisibleSelection&, bool, WTF::RefPtr<WebCore::Range>&)': /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/Source/WebCore/editing/Editor.cpp:2067:12: error: 'WTF_USE_GRAMMAR_CHECKING' was not declared in this scope /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/Source/WebCore/editing/Editor.cpp: In member function 'void WebCore::Editor::markBadGrammar(const WebCore::VisibleSelection&)': /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/Source/WebCore/editing/Editor.cpp:2095:8: error: 'WTF_USE_GRAMMAR_CHECKING' was not declared in this scope Link: http://build.webkit.sed.hu/builders/x86-64%20Linux%20Qt%20Debug/builds/29347 Could you check it please?
Similar build failure on GTK Linux 64-bit Debug WK1 http://build.webkit.org/builders/GTK%20Linux%2064-bit%20Debug%20WK1/builds/2607 also problems on Apple Win Debug: http://build.webkit.org/builders/Apple%20Win%20Debug%20%28Build%29/builds/67751
Reverted r151632 for reason: Debug build error ASSERT(WTF_USE_GRAMMAR_CHECKING) for non MAC platforms Committed r151638: <http://trac.webkit.org/changeset/151638>