RESOLVED FIXED Bug 181423
Merge sync and async code paths for getting context menus
https://bugs.webkit.org/show_bug.cgi?id=181423
Summary Merge sync and async code paths for getting context menus
Alex Christensen
Reported 2018-01-08 18:44:41 PST
Merge sync and async code paths for getting context menus
Attachments
Patch (16.64 KB, patch)
2018-01-08 18:53 PST, Alex Christensen
no flags
Patch (17.71 KB, patch)
2018-01-08 22:15 PST, Alex Christensen
no flags
Patch (17.71 KB, patch)
2018-01-16 13:52 PST, Alex Christensen
no flags
Alex Christensen
Comment 1 2018-01-08 18:53:08 PST
Alex Christensen
Comment 2 2018-01-08 18:53:34 PST
Could someone double check that context menus on linux work as before?
EWS Watchlist
Comment 3 2018-01-08 18:56:42 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Michael Catanzaro
Comment 4 2018-01-08 19:41:37 PST
(In reply to Alex Christensen from comment #2) > Could someone double check that context menus on linux work as before? I can look at it tomorrow, sure. Note: lib/libwebkit2gtk-4.0.so.37.26.1: error: undefined reference to 'WebKit::WebContextMenuListenerProxy::useContextMenuItems(WTF::Vector<WTF::Ref<WebKit::WebContextMenuItem, WTF::DumbPtrTraits<WebKit::WebContextMenuItem> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>&&)' lib/libwebkit2gtk-4.0.so.37.26.1: error: undefined reference to 'WebKit::WebContextMenuListenerProxy::WebContextMenuListenerProxy(WebKit::WebContextMenuProxy*)'
Alex Christensen
Comment 5 2018-01-08 22:15:05 PST
Michael Catanzaro
Comment 6 2018-01-09 09:23:08 PST
(In reply to Alex Christensen from comment #2) > Could someone double check that context menus on linux work as before? Yes, they're working fine!
Joseph Pecoraro
Comment 7 2018-01-10 19:22:29 PST
Comment on attachment 330794 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=330794&action=review r=me > Source/WebKit/UIProcess/API/glib/WebKitContextMenuClient.cpp:51 > webkitWebViewPopulateContextMenu(m_webView, menuItems, hitTestResultData, variant.get()); > - return true; > + contextMenuListener.useContextMenuItems({ }); So Glib does something special in `webkitWebViewPopulateContextMenu` instead of passing the new items to `contextMenuListener.useContextMenuItems`? I'm surprised this always passes an empty list to useContextMenuItems. Edit: Oh I think I see, gtk/WebContextMenuProxyGtk.cpp calls this with a mostly stub WebContextMenuListenerProxy, since WebContextMenuProxyGtk::showContextMenuWithItems does nothing (and which you just removed). I suppose it could be a real WebContextMenuListenerProxy that does the webkitWebViewPopulateContextMenu call instead of happening here in the client? Seems like it would amount to doing the same thing in the end.
Alex Christensen
Comment 8 2018-01-11 11:23:08 PST
Radar WebKit Bug Importer
Comment 9 2018-01-11 11:24:26 PST
Alex Christensen
Comment 10 2018-01-11 13:15:49 PST
WebKit Commit Bot
Comment 11 2018-01-11 16:13:25 PST
Re-opened since this is blocked by bug 181564
Alex Christensen
Comment 12 2018-01-11 16:14:15 PST
This broke API tests WebKit.ContextMenuImgWithVideo _WKDownload.RedirectedDownload
Alex Christensen
Comment 13 2018-01-16 13:52:44 PST
Comment on attachment 330794 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=330794&action=review > Source/WebKit/UIProcess/API/APIContextMenuClient.h:54 > + virtual void getContextMenuFromProposedMenu(WebKit::WebPageProxy&, Vector<Ref<WebKit::WebContextMenuItem>>&& /* proposedMenu */, WebKit::WebContextMenuListenerProxy& listener, const WebKit::WebHitTestResultData&, API::Object* /* userData */) { listener.useContextMenuItems({ }); } This broke the tests. Instead of calling the listener with an empty list, I needed to move proposedMenu into the listener. Oops.
Alex Christensen
Comment 14 2018-01-16 13:52:58 PST
Alex Christensen
Comment 15 2018-01-16 13:58:50 PST
Note You need to log in before you can comment on or make changes to this bug.