WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-210273-20200409170432.patch (text/plain), 9.12 KB, created by
Claudio Saavedra
on 2020-04-09 07:04:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Claudio Saavedra
Created:
2020-04-09 07:04:33 PDT
Size:
9.12 KB
patch
obsolete
>Subversion Revision: 259784 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 296753683e7c278315191b8b6950175ab8c944e7..9355776c50450d2a3dc95db60f98e75381b91af3 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,19 @@ >+2020-04-09 Claudio Saavedra <csaavedra@igalia.com> >+ >+ [GTK] Clean-up use of deprecated GtkAction >+ https://bugs.webkit.org/show_bug.cgi?id=210273 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ GtkAction is deprecated, however we use it because it's exposed >+ in the public API. Guard deprecated API usage to remove warnings and >+ update docs to not suggest using the deprecated API. >+ >+ * Shared/API/glib/WebKitContextMenuItem.cpp: >+ * Shared/glib/WebContextMenuItemGlib.cpp: >+ (WebKit::WebContextMenuItemGlib::buildActionName const): >+ (WebKit::WebContextMenuItemGlib::createActionIfNeeded): >+ > 2020-04-08 David Kilzer <ddkilzer@apple.com> > > WTF::Persistence::VectorCoder and IPC::VectorArgumentCoder should use checked arithmetic >diff --git a/Source/WebKit/Shared/API/glib/WebKitContextMenuItem.cpp b/Source/WebKit/Shared/API/glib/WebKitContextMenuItem.cpp >index faefed2dcc838ee95739065dac63f13563f0d3b0..e5d2e29e23b35d78fa6a0578b951ba54765f979a 100644 >--- a/Source/WebKit/Shared/API/glib/WebKitContextMenuItem.cpp >+++ b/Source/WebKit/Shared/API/glib/WebKitContextMenuItem.cpp >@@ -180,10 +180,10 @@ WebKitContextMenuItem* webkit_context_menu_item_new_from_gaction(GAction* action > * Stock actions are handled automatically by WebKit so that, for example, > * when a menu item created with a %WEBKIT_CONTEXT_MENU_ACTION_STOP is > * activated the action associated will be handled by WebKit and the current >- * load operation will be stopped. You can get the #GtkAction of a >+ * load operation will be stopped. You can get the #GAction of a > * #WebKitContextMenuItem created with a #WebKitContextMenuAction with >- * webkit_context_menu_item_get_action() and connect to #GtkAction::activate signal >- * to be notified when the item is activated. But you can't prevent the associated >+ * webkit_context_menu_item_get_gaction() and connect to the #GSimpleAction::activate signal >+ * to be notified when the item is activated, but you can't prevent the associated > * action from being performed. > * > * Returns: the newly created #WebKitContextMenuItem object. >diff --git a/Source/WebKit/Shared/glib/WebContextMenuItemGlib.cpp b/Source/WebKit/Shared/glib/WebContextMenuItemGlib.cpp >index 7f75a606c7222c309ee53f5787b0b88fdc17d681..23574e746f8566cefda5eda0c5c99fc8dcaddf89 100644 >--- a/Source/WebKit/Shared/glib/WebContextMenuItemGlib.cpp >+++ b/Source/WebKit/Shared/glib/WebContextMenuItemGlib.cpp >@@ -78,6 +78,7 @@ WebContextMenuItemGlib::WebContextMenuItemGlib(GAction* action, const String& ti > } > > #if PLATFORM(GTK) >+ALLOW_DEPRECATED_DECLARATIONS_BEGIN > WebContextMenuItemGlib::WebContextMenuItemGlib(GtkAction* action) > : WebContextMenuItemData(GTK_IS_TOGGLE_ACTION(action) ? CheckableActionType : ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(gtk_action_get_label(action)), gtk_action_get_sensitive(action), GTK_IS_TOGGLE_ACTION(action) ? gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)) : false) > { >@@ -85,6 +86,7 @@ WebContextMenuItemGlib::WebContextMenuItemGlib(GtkAction* action) > createActionIfNeeded(); > g_object_set_data_full(G_OBJECT(m_gAction.get()), "webkit-gtk-action", g_object_ref(m_gtkAction), g_object_unref); > } >+ALLOW_DEPRECATED_DECLARATIONS_END > #endif > > WebContextMenuItemGlib::~WebContextMenuItemGlib() >@@ -94,8 +96,10 @@ WebContextMenuItemGlib::~WebContextMenuItemGlib() > GUniquePtr<char> WebContextMenuItemGlib::buildActionName() const > { > #if PLATFORM(GTK) >+ALLOW_DEPRECATED_DECLARATIONS_BEGIN > if (m_gtkAction) > return GUniquePtr<char>(g_strdup(gtk_action_get_name(m_gtkAction))); >+ALLOW_DEPRECATED_DECLARATIONS_END > #endif > > static uint64_t actionID = 0; >@@ -117,6 +121,7 @@ void WebContextMenuItemGlib::createActionIfNeeded() > } > > #if PLATFORM(GTK) >+ALLOW_DEPRECATED_DECLARATIONS_BEGIN > // Create the GtkAction for backwards compatibility only. > if (!m_gtkAction) { > if (type() == CheckableActionType) { >@@ -129,6 +134,7 @@ void WebContextMenuItemGlib::createActionIfNeeded() > } > > g_signal_connect_object(m_gAction.get(), "activate", G_CALLBACK(gtk_action_activate), m_gtkAction, G_CONNECT_SWAPPED); >+ALLOW_DEPRECATED_DECLARATIONS_END > #endif > } > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 468ee45b2c9b0e0fb1e371cc9a5869a6939388ac..355ed3679d1ccaff141b27cf16b7e4a67aa43f5b 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,18 @@ >+2020-04-09 Claudio Saavedra <csaavedra@igalia.com> >+ >+ [GTK] Clean-up use of deprecated GtkAction >+ https://bugs.webkit.org/show_bug.cgi?id=210273 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ GtkAction is deprecated so remove usage of it in the >+ context menu API tests and guard its API usage when >+ we still need to use it to test the deprecated WebKitGTK+ API >+ exposing GtkAction. >+ >+ * TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp: >+ (testContextMenuPopulateMenu): >+ > 2020-04-08 Alex Christensen <achristensen@webkit.org> > > _corsDisablingPatterns should allow security policy access to those patterns >diff --git a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp >index 2b82ffa2d0d019f5fd3d746bc74e6f9ee73cb90a..c39e1df33e006efb3addbb39207990f6f8a4aabe 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebKitGtk/TestContextMenu.cpp >@@ -112,23 +112,20 @@ public: > return 0; > } > >- void checkActionState(GtkAction* action, unsigned state) >+ void checkActionState(GAction* action, unsigned state) > { >- if (state & Visible) >- g_assert_true(gtk_action_get_visible(action)); >- else >- g_assert_false(gtk_action_get_visible(action)); >- > if (state & Enabled) >- g_assert_true(gtk_action_get_sensitive(action)); >+ g_assert_true(g_action_get_enabled(action)); > else >- g_assert_false(gtk_action_get_sensitive(action)); >+ g_assert_false(g_action_get_enabled(action)); > >- if (GTK_IS_TOGGLE_ACTION(action)) { >+ const GVariantType* type = g_action_get_state_type(action); >+ if (type && g_variant_type_equal(type, G_VARIANT_TYPE_BOOLEAN)) { >+ GRefPtr<GVariant> actionState = adoptGRef(g_action_get_state(action)); > if (state & Checked) >- g_assert_true(gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))); >+ g_assert_true(g_variant_get_boolean(actionState.get())); > else >- g_assert_false(gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action))); >+ g_assert_false(g_variant_get_boolean(actionState.get())); > } > } > >@@ -150,7 +147,7 @@ public: > > g_assert_cmpint(webkit_context_menu_item_get_stock_action(item), ==, stockAction); > >- checkActionState(action, state); >+ checkActionState(gAction, state); > > return g_list_next(items); > } >@@ -166,7 +163,6 @@ public: > G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > GtkAction* action = webkit_context_menu_item_get_action(item); > g_assert_true(GTK_IS_ACTION(action)); >- G_GNUC_END_IGNORE_DEPRECATIONS; > > GAction* gAction = webkit_context_menu_item_get_gaction(item); > g_assert_true(G_IS_ACTION(gAction)); >@@ -181,8 +177,9 @@ public: > > g_assert_cmpint(webkit_context_menu_item_get_stock_action(item), ==, WEBKIT_CONTEXT_MENU_ACTION_CUSTOM); > g_assert_cmpstr(gtk_action_get_label(action), ==, label); >+ G_GNUC_END_IGNORE_DEPRECATIONS; > >- checkActionState(action, state); >+ checkActionState(gAction, state); > > return g_list_next(items); > } >@@ -204,7 +201,7 @@ public: > GAction* gAction = webkit_context_menu_item_get_gaction(item); > g_assert_true(G_IS_ACTION(gAction)); > >- checkActionState(action, state); >+ checkActionState(gAction, state); > > WebKitContextMenu* subMenu = webkit_context_menu_item_get_submenu(item); > g_assert_true(WEBKIT_IS_CONTEXT_MENU(subMenu)); >@@ -655,6 +652,7 @@ static void testContextMenuPopulateMenu(ContextMenuCustomTest* test, gconstpoint > test->loadHtml("<html><body>WebKitGTK Context menu tests</body></html>", "file:///"); > test->waitUntilLoadFinished(); > >+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS; > // Create a custom menu item. > GRefPtr<GtkAction> action = adoptGRef(gtk_action_new("WebKitGTKCustomAction", "Custom _Action", nullptr, nullptr)); > test->setAction(action.get()); >@@ -670,6 +668,7 @@ static void testContextMenuPopulateMenu(ContextMenuCustomTest* test, gconstpoint > test->toggleCustomMenuItemAndWaitUntilToggled(gtk_action_get_label(toggleAction.get())); > g_assert_false(test->m_activated); > g_assert_true(test->m_toggled); >+ G_GNUC_END_IGNORE_DEPRECATIONS; > > // Create a custom menu item using GAction. > GRefPtr<GAction> gAction = adoptGRef(G_ACTION(g_simple_action_new("WebKitGTKCustomGAction", nullptr)));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 210273
: 395946