Title: [151638] trunk/Source
Revision
151638
Author
g.czajkow...@samsung.com
Date
2013-06-17 06:32:09 -0700 (Mon, 17 Jun 2013)

Log Message

Unreviewed, rolling out r151632.
http://trac.webkit.org/changeset/151632
https://bugs.webkit.org/show_bug.cgi?id=117585

Debug build error ASSERT(WTF_USE_GRAMMAR_CHECKING) for non MAC
platforms

Source/WebCore:

* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
(WebCore::ContextMenuController::createAndAppendSpellingAndGrammarSubMenu):
(WebCore::ContextMenuController::populate):
(WebCore::ContextMenuController::checkOrEnableIfNeeded):
* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagSpellingMenu):
(WebCore::contextMenuItemTagShowSpellingPanel):
(WebCore::contextMenuItemTagCheckGrammarWithSpelling):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::contextMenuItemTagSpellingMenu):
(WebCore::contextMenuItemTagShowSpellingPanel):
(WebCore::contextMenuItemTagCheckGrammarWithSpelling):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::contextMenuItemTagSpellingMenu):
(WebCore::contextMenuItemTagShowSpellingPanel):
(WebCore::contextMenuItemTagCheckGrammarWithSpelling):
* platform/qt/LocalizedStringsQt.cpp:
(WebCore::contextMenuItemTagSpellingMenu):
(WebCore::contextMenuItemTagShowSpellingPanel):
(WebCore::contextMenuItemTagCheckGrammarWithSpelling):

Source/WebKit/gtk:

* webkit/webkitglobals.cpp:
(webkit_context_menu_item_get_action):

Source/WebKit/mac:

* WebCoreSupport/WebContextMenuClient.mm:
(fixMenusReceivedFromOldClients):

Source/WebKit2:

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):
* UIProcess/API/efl/ewk_context_menu_item.cpp:
(getEwkActionFromWKTag):
* UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:
(onContextMenuShow):
(TEST_F):
* UIProcess/API/gtk/WebKitContextMenuActions.cpp:
(webkitContextMenuActionGetActionTag):
(webkitContextMenuActionGetForContextMenuItem):
(webkitContextMenuActionGetLabel):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::contextMenuItemSelected):

Source/WTF:

* wtf/Platform.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (151637 => 151638)


--- trunk/Source/WTF/ChangeLog	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WTF/ChangeLog	2013-06-17 13:32:09 UTC (rev 151638)
@@ -1,3 +1,14 @@
+2013-06-17  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
+
+        Unreviewed, rolling out r151632.
+        http://trac.webkit.org/changeset/151632
+        https://bugs.webkit.org/show_bug.cgi?id=117585
+
+        Debug build error ASSERT(WTF_USE_GRAMMAR_CHECKING) for non MAC
+        platforms
+
+        * wtf/Platform.h:
+
 2013-06-14  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
 
         Context menu grammar checking items are available when GRAMMAR_CHECKING macro is off

Modified: trunk/Source/WTF/wtf/Platform.h (151637 => 151638)


--- trunk/Source/WTF/wtf/Platform.h	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WTF/wtf/Platform.h	2013-06-17 13:32:09 UTC (rev 151638)
@@ -1004,9 +1004,7 @@
 #endif
 
 
-#if PLATFORM(MAC)
 #define WTF_USE_GRAMMAR_CHECKING 1
-#endif
 
 #if PLATFORM(MAC) || PLATFORM(BLACKBERRY) || PLATFORM(EFL)
 #define WTF_USE_UNIFIED_TEXT_CHECKING 1

Modified: trunk/Source/WebCore/ChangeLog (151637 => 151638)


--- trunk/Source/WebCore/ChangeLog	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebCore/ChangeLog	2013-06-17 13:32:09 UTC (rev 151638)
@@ -1,3 +1,35 @@
+2013-06-17  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
+
+        Unreviewed, rolling out r151632.
+        http://trac.webkit.org/changeset/151632
+        https://bugs.webkit.org/show_bug.cgi?id=117585
+
+        Debug build error ASSERT(WTF_USE_GRAMMAR_CHECKING) for non MAC
+        platforms
+
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::contextMenuItemSelected):
+        (WebCore::ContextMenuController::createAndAppendSpellingAndGrammarSubMenu):
+        (WebCore::ContextMenuController::populate):
+        (WebCore::ContextMenuController::checkOrEnableIfNeeded):
+        * platform/LocalizedStrings.cpp:
+        (WebCore::contextMenuItemTagSpellingMenu):
+        (WebCore::contextMenuItemTagShowSpellingPanel):
+        (WebCore::contextMenuItemTagCheckGrammarWithSpelling):
+        * platform/LocalizedStrings.h:
+        * platform/efl/LocalizedStringsEfl.cpp:
+        (WebCore::contextMenuItemTagSpellingMenu):
+        (WebCore::contextMenuItemTagShowSpellingPanel):
+        (WebCore::contextMenuItemTagCheckGrammarWithSpelling):
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::contextMenuItemTagSpellingMenu):
+        (WebCore::contextMenuItemTagShowSpellingPanel):
+        (WebCore::contextMenuItemTagCheckGrammarWithSpelling):
+        * platform/qt/LocalizedStringsQt.cpp:
+        (WebCore::contextMenuItemTagSpellingMenu):
+        (WebCore::contextMenuItemTagShowSpellingPanel):
+        (WebCore::contextMenuItemTagCheckGrammarWithSpelling):
+
 2013-06-17  Carlos Garcia Campos  <cgar...@igalia.com>
 
         Unreviewed. Fix make distcheck.

Modified: trunk/Source/WebCore/page/ContextMenuController.cpp (151637 => 151638)


--- trunk/Source/WebCore/page/ContextMenuController.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebCore/page/ContextMenuController.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -448,11 +448,9 @@
     case ContextMenuItemTagCheckSpellingWhileTyping:
         frame->editor().toggleContinuousSpellChecking();
         break;
-#if USE(GRAMMAR_CHECKING)
     case ContextMenuItemTagCheckGrammarWithSpelling:
         frame->editor().toggleGrammarChecking();
         break;
-#endif
 #if PLATFORM(MAC)
     case ContextMenuItemTagShowFonts:
         frame->editor().showFontPanel();
@@ -569,10 +567,8 @@
         contextMenuItemTagCheckSpelling());
     ContextMenuItem checkAsYouType(CheckableActionType, ContextMenuItemTagCheckSpellingWhileTyping, 
         contextMenuItemTagCheckSpellingWhileTyping());
-#if USE(GRAMMAR_CHECKING)
     ContextMenuItem grammarWithSpelling(CheckableActionType, ContextMenuItemTagCheckGrammarWithSpelling, 
         contextMenuItemTagCheckGrammarWithSpelling());
-#endif
 #if PLATFORM(MAC)
     ContextMenuItem correctSpelling(CheckableActionType, ContextMenuItemTagCorrectSpellingAutomatically, 
         contextMenuItemTagCorrectSpellingAutomatically());
@@ -584,9 +580,7 @@
     appendItem(*separatorItem(), &spellingAndGrammarMenu);
 #endif
     appendItem(checkAsYouType, &spellingAndGrammarMenu);
-#if USE(GRAMMAR_CHECKING)
     appendItem(grammarWithSpelling, &spellingAndGrammarMenu);
-#endif
 #if PLATFORM(MAC)
     appendItem(correctSpelling, &spellingAndGrammarMenu);
 #endif
@@ -801,10 +795,8 @@
         contextMenuItemTagIgnoreSpelling());
     ContextMenuItem LearnSpellingItem(ActionType, ContextMenuItemTagLearnSpelling, 
         contextMenuItemTagLearnSpelling());
-#if USE(GRAMMAR_CHECKING)
     ContextMenuItem IgnoreGrammarItem(ActionType, ContextMenuItemTagIgnoreGrammar, 
         contextMenuItemTagIgnoreGrammar());
-#endif
     ContextMenuItem CutItem(ActionType, ContextMenuItemTagCut, contextMenuItemTagCut());
     ContextMenuItem PasteItem(ActionType, ContextMenuItemTagPaste, contextMenuItemTagPaste());
 #if PLATFORM(GTK)
@@ -974,12 +966,8 @@
                     if (misspelling) {
                         appendItem(IgnoreSpellingItem, m_contextMenu.get());
                         appendItem(LearnSpellingItem, m_contextMenu.get());
-                    }
-#if USE(GRAMMAR_CHECKING)
-                    else
+                    } else
                         appendItem(IgnoreGrammarItem, m_contextMenu.get());
-#endif
-
                     appendItem(*separatorItem(), m_contextMenu.get());
                     haveContextMenuItemsForMisspellingOrGrammer = true;
 #if PLATFORM(MAC)
@@ -1242,13 +1230,11 @@
         case ContextMenuItemTagLookUpInDictionary:
             shouldEnable = frame->selection()->isRange();
             break;
-#if USE(GRAMMAR_CHECKING)
         case ContextMenuItemTagCheckGrammarWithSpelling:
             if (frame->editor().isGrammarCheckingEnabled())
                 shouldCheck = true;
             shouldEnable = true;
             break;
-#endif
         case ContextMenuItemTagItalic: {
             shouldCheck = frame->editor().selectionHasStyle(CSSPropertyFontStyle, "italic") != FalseTriState;
             shouldEnable = frame->editor().canEditRichly();
@@ -1394,9 +1380,7 @@
         case ContextMenuItemPDFNextPage:
         case ContextMenuItemPDFPreviousPage:
         case ContextMenuItemTagOpenLink:
-#if USE(GRAMMAR_CHECKING)
         case ContextMenuItemTagIgnoreGrammar:
-#endif
         case ContextMenuItemTagSpellingMenu:
         case ContextMenuItemTagShowFonts:
         case ContextMenuItemTagStyles:
@@ -1426,8 +1410,6 @@
             shouldEnable = m_hitTestResult.mediaHasAudio();
             shouldCheck = shouldEnable &&  m_hitTestResult.mediaMuted();
             break;
-        default:
-            break;
     }
 
     item.setChecked(shouldCheck);

Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (151637 => 151638)


--- trunk/Source/WebCore/platform/LocalizedStrings.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -271,38 +271,21 @@
     return WEB_UI_STRING("Open Link", "Open Link context menu item");
 }
 
-#if USE(GRAMMAR_CHECKING)
 String contextMenuItemTagIgnoreGrammar()
 {
     return WEB_UI_STRING("Ignore Grammar", "Ignore Grammar context menu item");
 }
 
-String contextMenuItemTagCheckGrammarWithSpelling()
-{
-    return WEB_UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
-}
-#endif
-
 String contextMenuItemTagSpellingMenu()
 {
-#if USE(GRAMMAR_CHECKING)
     return WEB_UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item");
-#else
-    return WEB_UI_STRING("Spelling", "Spelling context sub-menu item");
-#endif
 }
 
 String contextMenuItemTagShowSpellingPanel(bool show)
 {
-#if USE(GRAMMAR_CHECKING)
     if (show)
         return WEB_UI_STRING("Show Spelling and Grammar", "menu item title");
     return WEB_UI_STRING("Hide Spelling and Grammar", "menu item title");
-#else
-    if (show)
-        return WEB_UI_STRING("Show Spelling", "menu item title");
-    return WEB_UI_STRING("Hide Spelling", "menu item title");
-#endif
 }
 
 String contextMenuItemTagCheckSpelling()
@@ -315,6 +298,11 @@
     return WEB_UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item");
 }
 
+String contextMenuItemTagCheckGrammarWithSpelling()
+{
+    return WEB_UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item");
+}
+
 String contextMenuItemTagFontMenu()
 {
     return WEB_UI_STRING("Font", "Font context sub-menu item");

Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (151637 => 151638)


--- trunk/Source/WebCore/platform/LocalizedStrings.h	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h	2013-06-17 13:32:09 UTC (rev 151638)
@@ -92,14 +92,12 @@
     String contextMenuItemTagSearchWeb();
     String contextMenuItemTagLookUpInDictionary(const String& selectedString);
     String contextMenuItemTagOpenLink();
-#if USE(GRAMMAR_CHECKING)
     String contextMenuItemTagIgnoreGrammar();
-    String contextMenuItemTagCheckGrammarWithSpelling();
-#endif
     String contextMenuItemTagSpellingMenu();
     String contextMenuItemTagShowSpellingPanel(bool show);
     String contextMenuItemTagCheckSpelling();
     String contextMenuItemTagCheckSpellingWhileTyping();
+    String contextMenuItemTagCheckGrammarWithSpelling();
     String contextMenuItemTagFontMenu();
     String contextMenuItemTagBold();
     String contextMenuItemTagItalic();

Modified: trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp (151637 => 151638)


--- trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -258,34 +258,19 @@
     return String::fromUTF8("Open Link");
 }
 
-#if USE(GRAMMAR_CHECKING)
 String contextMenuItemTagIgnoreGrammar()
 {
     return String::fromUTF8("Ignore Grammar");
 }
 
-String contextMenuItemTagCheckGrammarWithSpelling()
-{
-    return String::fromUTF8("Check Grammar With Spelling");
-}
-#endif
-
 String contextMenuItemTagSpellingMenu()
 {
-#if USE(GRAMMAR_CHECKING)
     return String::fromUTF8("Spelling and Grammar");
-#else
-    return String::fromUTF8("Spelling");
-#endif
 }
 
 String contextMenuItemTagShowSpellingPanel(bool show)
 {
-#if USE(GRAMMAR_CHECKING)
     return String::fromUTF8(show ? "Show Spelling and Grammar" : "Hide Spelling and Grammar");
-#else
-    return String::fromUTF8(show ? "Show Spelling" : "Hide Spelling");
-#endif
 }
 
 String contextMenuItemTagCheckSpelling()
@@ -298,6 +283,11 @@
     return String::fromUTF8("Check Spelling While Typing");
 }
 
+String contextMenuItemTagCheckGrammarWithSpelling()
+{
+    return String::fromUTF8("Check Grammar With Spelling");
+}
+
 String contextMenuItemTagFontMenu()
 {
     return String::fromUTF8("Font");

Modified: trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp (151637 => 151638)


--- trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -279,34 +279,19 @@
     return String::fromUTF8(_("_Open Link"));
 }
 
-#if USE(GRAMMAR_CHECKING)
 String contextMenuItemTagIgnoreGrammar()
 {
     return String::fromUTF8(_("Ignore _Grammar"));
 }
 
-String contextMenuItemTagCheckGrammarWithSpelling()
-{
-    return String::fromUTF8(_("Check _Grammar With Spelling"));
-}
-#endif
-
 String contextMenuItemTagSpellingMenu()
 {
-#if USE(GRAMMAR_CHECKING)
     return String::fromUTF8(_("Spelling and _Grammar"));
-#else
-    return String::fromUTF8(_("Spelling"));
-#endif
 }
 
 String contextMenuItemTagShowSpellingPanel(bool show)
 {
-#if USE(GRAMMAR_CHECKING)
     return String::fromUTF8(show ? _("_Show Spelling and Grammar") : _("_Hide Spelling and Grammar"));
-#else
-    return String::fromUTF8(show ? _("_Show Spelling") : _("_Hide Spelling"));
-#endif
 }
 
 String contextMenuItemTagCheckSpelling()
@@ -319,6 +304,11 @@
     return String::fromUTF8(_("Check Spelling While _Typing"));
 }
 
+String contextMenuItemTagCheckGrammarWithSpelling()
+{
+    return String::fromUTF8(_("Check _Grammar With Spelling"));
+}
+
 String contextMenuItemTagFontMenu()
 {
     return String::fromUTF8(_("_Font"));

Modified: trunk/Source/WebCore/platform/qt/LocalizedStringsQt.cpp (151637 => 151638)


--- trunk/Source/WebCore/platform/qt/LocalizedStringsQt.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebCore/platform/qt/LocalizedStringsQt.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -248,36 +248,20 @@
     return QCoreApplication::translate("QWebPage", "Open Link", "Open Link context menu item");
 }
 
-#if USE(GRAMMAR_CHECKING)
 String contextMenuItemTagIgnoreGrammar()
 {
     return QCoreApplication::translate("QWebPage", "Ignore", "Ignore Grammar context menu item");
 }
 
-String contextMenuItemTagCheckGrammarWithSpelling()
-{
-    return QCoreApplication::translate("QWebPage", "Check Grammar With Spelling", "Check grammar with spelling context menu item");
-}
-#endif
-
 String contextMenuItemTagSpellingMenu()
 {
-#if USE(GRAMMAR_CHECKING)
     return QCoreApplication::translate("QWebPage", "Spelling", "Spelling and Grammar context sub-menu item");
-#else
-    return QCoreApplication::translate("QWebPage", "Spelling", "Spelling context sub-menu item");
-#endif
 }
 
 String contextMenuItemTagShowSpellingPanel(bool show)
 {
-#if USE(GRAMMAR_CHECKING)
     return show ? QCoreApplication::translate("QWebPage", "Show Spelling and Grammar", "menu item title") :
-        QCoreApplication::translate("QWebPage", "Hide Spelling and Grammar", "menu item title");
-#else
-    return show ? QCoreApplication::translate("QWebPage", "Show Spelling", "menu item title") :
-        QCoreApplication::translate("QWebPage", "Hide Spelling", "menu item title");
-#endif
+                  QCoreApplication::translate("QWebPage", "Hide Spelling and Grammar", "menu item title");
 }
 
 String contextMenuItemTagCheckSpelling()
@@ -290,6 +274,11 @@
     return QCoreApplication::translate("QWebPage", "Check Spelling While Typing", "Check spelling while typing context menu item");
 }
 
+String contextMenuItemTagCheckGrammarWithSpelling()
+{
+    return QCoreApplication::translate("QWebPage", "Check Grammar With Spelling", "Check grammar with spelling context menu item");
+}
+
 String contextMenuItemTagFontMenu()
 {
     return QCoreApplication::translate("QWebPage", "Fonts", "Font context sub-menu item");

Modified: trunk/Source/WebKit/gtk/ChangeLog (151637 => 151638)


--- trunk/Source/WebKit/gtk/ChangeLog	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit/gtk/ChangeLog	2013-06-17 13:32:09 UTC (rev 151638)
@@ -1,3 +1,15 @@
+2013-06-17  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
+
+        Unreviewed, rolling out r151632.
+        http://trac.webkit.org/changeset/151632
+        https://bugs.webkit.org/show_bug.cgi?id=117585
+
+        Debug build error ASSERT(WTF_USE_GRAMMAR_CHECKING) for non MAC
+        platforms
+
+        * webkit/webkitglobals.cpp:
+        (webkit_context_menu_item_get_action):
+
 2013-06-14  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
 
         Context menu grammar checking items are available when GRAMMAR_CHECKING macro is off

Modified: trunk/Source/WebKit/gtk/webkit/webkitglobals.cpp (151637 => 151638)


--- trunk/Source/WebKit/gtk/webkit/webkitglobals.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit/gtk/webkit/webkitglobals.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -428,10 +428,8 @@
         return WEBKIT_CONTEXT_MENU_ACTION_IGNORE_SPELLING;
     case ContextMenuItemTagLearnSpelling:
         return WEBKIT_CONTEXT_MENU_ACTION_LEARN_SPELLING;
-#if USE(GRAMMAR_CHECKING)
     case ContextMenuItemTagIgnoreGrammar:
         return WEBKIT_CONTEXT_MENU_ACTION_IGNORE_GRAMMAR;
-#endif
     case ContextMenuItemTagFontMenu:
         return WEBKIT_CONTEXT_MENU_ACTION_FONT_MENU;
     case ContextMenuItemTagBold:

Modified: trunk/Source/WebKit/mac/ChangeLog (151637 => 151638)


--- trunk/Source/WebKit/mac/ChangeLog	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit/mac/ChangeLog	2013-06-17 13:32:09 UTC (rev 151638)
@@ -1,3 +1,15 @@
+2013-06-17  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
+
+        Unreviewed, rolling out r151632.
+        http://trac.webkit.org/changeset/151632
+        https://bugs.webkit.org/show_bug.cgi?id=117585
+
+        Debug build error ASSERT(WTF_USE_GRAMMAR_CHECKING) for non MAC
+        platforms
+
+        * WebCoreSupport/WebContextMenuClient.mm:
+        (fixMenusReceivedFromOldClients):
+
 2013-06-14  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
 
         Context menu grammar checking items are available when GRAMMAR_CHECKING macro is off

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm (151637 => 151638)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm	2013-06-17 13:32:09 UTC (rev 151638)
@@ -165,12 +165,8 @@
             NSString *title = [item title];
             if ([title isEqualToString:contextMenuItemTagOpenLink()])
                 modernTag = WebMenuItemTagOpenLink;
-#if USE(GRAMMAR_CHECKING)
             else if ([title isEqualToString:contextMenuItemTagIgnoreGrammar()])
                 modernTag = WebMenuItemTagIgnoreGrammar;
-            else if ([title isEqualToString:contextMenuItemTagCheckGrammarWithSpelling()])
-                modernTag = WebMenuItemTagCheckGrammarWithSpelling;
-#endif
             else if ([title isEqualToString:contextMenuItemTagSpellingMenu()])
                 modernTag = WebMenuItemTagSpellingMenu;
             else if ([title isEqualToString:contextMenuItemTagShowSpellingPanel(true)]
@@ -180,6 +176,8 @@
                 modernTag = WebMenuItemTagCheckSpelling;
             else if ([title isEqualToString:contextMenuItemTagCheckSpellingWhileTyping()])
                 modernTag = WebMenuItemTagCheckSpellingWhileTyping;
+            else if ([title isEqualToString:contextMenuItemTagCheckGrammarWithSpelling()])
+                modernTag = WebMenuItemTagCheckGrammarWithSpelling;
             else if ([title isEqualToString:contextMenuItemTagFontMenu()])
                 modernTag = WebMenuItemTagFontMenu;
             else if ([title isEqualToString:contextMenuItemTagShowFonts()])

Modified: trunk/Source/WebKit2/ChangeLog (151637 => 151638)


--- trunk/Source/WebKit2/ChangeLog	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit2/ChangeLog	2013-06-17 13:32:09 UTC (rev 151638)
@@ -1,3 +1,27 @@
+2013-06-17  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
+
+        Unreviewed, rolling out r151632.
+        http://trac.webkit.org/changeset/151632
+        https://bugs.webkit.org/show_bug.cgi?id=117585
+
+        Debug build error ASSERT(WTF_USE_GRAMMAR_CHECKING) for non MAC
+        platforms
+
+        * Shared/API/c/WKSharedAPICast.h:
+        (WebKit::toAPI):
+        (WebKit::toImpl):
+        * UIProcess/API/efl/ewk_context_menu_item.cpp:
+        (getEwkActionFromWKTag):
+        * UIProcess/API/efl/tests/test_ewk2_text_checker.cpp:
+        (onContextMenuShow):
+        (TEST_F):
+        * UIProcess/API/gtk/WebKitContextMenuActions.cpp:
+        (webkitContextMenuActionGetActionTag):
+        (webkitContextMenuActionGetForContextMenuItem):
+        (webkitContextMenuActionGetLabel):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::contextMenuItemSelected):
+
 2013-06-14  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
 
         Context menu grammar checking items are available when GRAMMAR_CHECKING macro is off

Modified: trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h (151637 => 151638)


--- trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h	2013-06-17 13:32:09 UTC (rev 151638)
@@ -400,12 +400,8 @@
         return kWKContextMenuItemTagPDFPreviousPage;
     case WebCore::ContextMenuItemTagOpenLink:
         return kWKContextMenuItemTagOpenLink;
-#if USE(GRAMMAR_CHECKING)
     case WebCore::ContextMenuItemTagIgnoreGrammar:
         return kWKContextMenuItemTagIgnoreGrammar;
-    case WebCore::ContextMenuItemTagCheckGrammarWithSpelling:
-        return kWKContextMenuItemTagCheckGrammarWithSpelling;
-#endif
     case WebCore::ContextMenuItemTagSpellingMenu:
         return kWKContextMenuItemTagSpellingMenu;
     case WebCore::ContextMenuItemTagShowSpellingPanel:
@@ -414,6 +410,8 @@
         return kWKContextMenuItemTagCheckSpelling;
     case WebCore::ContextMenuItemTagCheckSpellingWhileTyping:
         return kWKContextMenuItemTagCheckSpellingWhileTyping;
+    case WebCore::ContextMenuItemTagCheckGrammarWithSpelling:
+        return kWKContextMenuItemTagCheckGrammarWithSpelling;
     case WebCore::ContextMenuItemTagFontMenu:
         return kWKContextMenuItemTagFontMenu;
     case WebCore::ContextMenuItemTagShowFonts:
@@ -594,12 +592,8 @@
         return WebCore::ContextMenuItemPDFPreviousPage;
     case kWKContextMenuItemTagOpenLink:
         return WebCore::ContextMenuItemTagOpenLink;
-#if USE(GRAMMAR_CHECKING)
     case kWKContextMenuItemTagIgnoreGrammar:
         return WebCore::ContextMenuItemTagIgnoreGrammar;
-    case kWKContextMenuItemTagCheckGrammarWithSpelling:
-        return WebCore::ContextMenuItemTagCheckGrammarWithSpelling;
-#endif
     case kWKContextMenuItemTagSpellingMenu:
         return WebCore::ContextMenuItemTagSpellingMenu;
     case kWKContextMenuItemTagShowSpellingPanel:
@@ -608,6 +602,8 @@
         return WebCore::ContextMenuItemTagCheckSpelling;
     case kWKContextMenuItemTagCheckSpellingWhileTyping:
         return WebCore::ContextMenuItemTagCheckSpellingWhileTyping;
+    case kWKContextMenuItemTagCheckGrammarWithSpelling:
+        return WebCore::ContextMenuItemTagCheckGrammarWithSpelling;
     case kWKContextMenuItemTagFontMenu:
         return WebCore::ContextMenuItemTagFontMenu;
     case kWKContextMenuItemTagShowFonts:

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item.cpp (151637 => 151638)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -242,12 +242,8 @@
         return EWK_CONTEXT_MENU_ITEM_PDFPREVIOUS_PAGE;
     case kWKContextMenuItemTagOpenLink:
         return EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK;
-#if USE(GRAMMAR_CHECKING)
     case kWKContextMenuItemTagIgnoreGrammar:
         return EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_GRAMMAR;
-    case kWKContextMenuItemTagCheckGrammarWithSpelling:
-        return EWK_CONTEXT_MENU_ITEM_TAG_CHECK_GRAMMAR_WITH_SPELLING;
-#endif
     case kWKContextMenuItemTagSpellingMenu:
         return EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU;
     case kWKContextMenuItemTagShowSpellingPanel:
@@ -256,6 +252,8 @@
         return EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING;
     case kWKContextMenuItemTagCheckSpellingWhileTyping:
         return EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING_WHILE_TYPING;
+    case kWKContextMenuItemTagCheckGrammarWithSpelling:
+        return EWK_CONTEXT_MENU_ITEM_TAG_CHECK_GRAMMAR_WITH_SPELLING;
     case kWKContextMenuItemTagFontMenu:
         return EWK_CONTEXT_MENU_ITEM_TAG_FONT_MENU;
     case kWKContextMenuItemTagShowFonts:

Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp (151637 => 151638)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_text_checker.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -217,7 +217,7 @@
     callbacksExecutionStats.wordIgnore = true;
 }
 
-static Eina_Bool checkSpellingItemsAvailability(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
+static Eina_Bool onContextMenuShow(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
 {
     const Eina_List* contextMenuItems = ewk_context_menu_items_get(contextMenu);
 
@@ -245,63 +245,6 @@
     return true;
 }
 
-static Eina_Bool checkSpellingAndGrammarSubmenuAvailability(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
-{
-    const Eina_List* contextMenuItems = ewk_context_menu_items_get(contextMenu);
-    bool isSpellingAndGrammarSubMenuAvailable = false;
-
-    const Eina_List* listIterator;
-    void* itemData;
-    EINA_LIST_FOREACH(contextMenuItems, listIterator, itemData) {
-        Ewk_Context_Menu_Item* item = static_cast<Ewk_Context_Menu_Item*>(itemData);
-        if (ewk_context_menu_item_type_get(item) == EWK_SUBMENU_TYPE
-            && ewk_context_menu_item_action_get(item) == EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU) {
-                isSpellingAndGrammarSubMenuAvailable = true;
-                break;
-        }
-    }
-
-    EXPECT_TRUE(isSpellingAndGrammarSubMenuAvailable);
-
-    wasContextMenuShown = true;
-    return true;
-}
-
-static Eina_Bool checkGrammarWithSpellingItemAvailability(Ewk_View_Smart_Data*, Evas_Coord, Evas_Coord, Ewk_Context_Menu* contextMenu)
-{
-    const Eina_List* contextMenuItems = ewk_context_menu_items_get(contextMenu);
-    bool isGrammarWtihSpellingItemAvailable = false;
-
-    const Eina_List* menuIterator;
-    void* itemData;
-    EINA_LIST_FOREACH(contextMenuItems, menuIterator, itemData) {
-        Ewk_Context_Menu_Item* item = static_cast<Ewk_Context_Menu_Item*>(itemData);
-        if (ewk_context_menu_item_type_get(item) == EWK_SUBMENU_TYPE
-            && ewk_context_menu_item_action_get(item) == EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU) {
-                Ewk_Context_Menu* spellingAndGrammarSubmenu = ewk_context_menu_item_submenu_get(item);
-                const Eina_List* spellingAndGrammarSubmenuItems = ewk_context_menu_items_get(spellingAndGrammarSubmenu);
-                const Eina_List* submenuIterator;
-
-                EINA_LIST_FOREACH(spellingAndGrammarSubmenuItems, submenuIterator, itemData) {
-                    Ewk_Context_Menu_Item* submenuItem = static_cast<Ewk_Context_Menu_Item*>(itemData);
-                    if (ewk_context_menu_item_action_get(submenuItem) == EWK_CONTEXT_MENU_ITEM_TAG_CHECK_GRAMMAR_WITH_SPELLING) {
-                        isGrammarWtihSpellingItemAvailable = true;
-                        break;
-                    }
-                }
-        }
-    }
-
-#if USE(GRAMMAR_CHECKING)
-    EXPECT_TRUE(isGrammarWtihSpellingItemAvailable);
-#else
-    EXPECT_FALSE(isGrammarWtihSpellingItemAvailable);
-#endif
-
-    wasContextMenuShown = true;
-    return true;
-}
-
 /**
  * Test whether the default language is loaded independently of
  * continuous spell checking setting.
@@ -346,7 +289,7 @@
 TEST_F(EWK2UnitTestBase, context_menu_spelling_items_availability)
 {
     ewk_text_checker_continuous_spell_checking_enabled_set(false);
-    ewkViewClass()->context_menu_show = checkSpellingItemsAvailability;
+    ewkViewClass()->context_menu_show = onContextMenuShow;
 
     ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
     mouseClick(10, 20, 3 /* Right button */);
@@ -356,35 +299,6 @@
 }
 
 /**
- * Test whether "Spelling and Grammar" sub menu is available.
- */
-TEST_F(EWK2UnitTestBase, context_menu_spelling_submenu_availability)
-{
-    wasContextMenuShown = false;
-    ewkViewClass()->context_menu_show = checkSpellingAndGrammarSubmenuAvailability;
-
-    ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
-    mouseClick(10, 20, 3 /* Right button */);
-
-    ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
-}
-
-/**
- * Test whether "Check Grammar wth Spelling" is available
- * only when GRAMMAR_CHECKING is enabled.
- */
-TEST_F(EWK2UnitTestBase, context_menu_grammar_item_availability)
-{
-    wasContextMenuShown = false;
-    ewkViewClass()->context_menu_show = checkGrammarWithSpellingItemAvailability;
-
-    ASSERT_TRUE(loadUrlSync(environment->urlForResource("spelling_test.html").data()));
-    mouseClick(10, 20, 3 /* Right button */);
-
-    ASSERT_TRUE(waitUntilTrue(wasContextMenuShown));
-}
-
-/**
  * Test setter/getter for the continuous spell checking:
  *  - ewk_text_checker_continuous_spell_checking_enabled_get
  *  - ewk_text_checker_continuous_spell_checking_enabled_set

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp (151637 => 151638)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -92,10 +92,8 @@
         return ContextMenuItemTagIgnoreSpelling;
     case WEBKIT_CONTEXT_MENU_ACTION_LEARN_SPELLING:
         return ContextMenuItemTagLearnSpelling;
-#if USE(GRAMMAR_CHECKING)
     case WEBKIT_CONTEXT_MENU_ACTION_IGNORE_GRAMMAR:
         return ContextMenuItemTagIgnoreGrammar;
-#endif
     case WEBKIT_CONTEXT_MENU_ACTION_FONT_MENU:
         return ContextMenuItemTagFontMenu;
     case WEBKIT_CONTEXT_MENU_ACTION_BOLD:
@@ -185,10 +183,8 @@
         return WEBKIT_CONTEXT_MENU_ACTION_IGNORE_SPELLING;
     case ContextMenuItemTagLearnSpelling:
         return WEBKIT_CONTEXT_MENU_ACTION_LEARN_SPELLING;
-#if USE(GRAMMAR_CHECKING)
     case ContextMenuItemTagIgnoreGrammar:
         return WEBKIT_CONTEXT_MENU_ACTION_IGNORE_GRAMMAR;
-#endif
     case ContextMenuItemTagFontMenu:
         return WEBKIT_CONTEXT_MENU_ACTION_FONT_MENU;
     case ContextMenuItemTagBold:
@@ -276,10 +272,8 @@
         return contextMenuItemTagIgnoreSpelling();
     case WEBKIT_CONTEXT_MENU_ACTION_LEARN_SPELLING:
         return contextMenuItemTagLearnSpelling();
-#if USE(GRAMMAR_CHECKING)
     case WEBKIT_CONTEXT_MENU_ACTION_IGNORE_GRAMMAR:
         return contextMenuItemTagIgnoreGrammar();
-#endif
     case WEBKIT_CONTEXT_MENU_ACTION_FONT_MENU:
         return contextMenuItemTagFontMenu();
     case WEBKIT_CONTEXT_MENU_ACTION_BOLD:

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (151637 => 151638)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-06-17 12:24:28 UTC (rev 151637)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2013-06-17 13:32:09 UTC (rev 151638)
@@ -3349,13 +3349,11 @@
         m_process->updateTextCheckerState();
         return;
     }
-#if USE(GRAMMAR_CHECKING)
     if (item.action() == ContextMenuItemTagCheckGrammarWithSpelling) {
         TextChecker::setGrammarCheckingEnabled(!TextChecker::state().isGrammarCheckingEnabled);
         m_process->updateTextCheckerState();
         return;
     }
-#endif
     if (item.action() == ContextMenuItemTagShowSpellingPanel) {
         if (!TextChecker::spellingUIIsShowing())
             advanceToNextMisspelling(true);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to