Currently WebKit doesn't allow any client to display the context menu asynchronously. We should add ability for the client to provide the list of context menu items to WebKit asynchronously.
Created attachment 291536 [details] Proposed patch.
Created attachment 291651 [details] Patch
Attachment 291651 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/WebContextMenuListenerProxy.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] ERROR: Source/WebKit2/UIProcess/API/C/WKContextMenuListener.h:26: Use #pragma once instead of #ifndef for header guard. [build/header_guard] [5] Total errors found: 2 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 291651 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291651&action=review > Source/WebKit2/UIProcess/API/C/WKPage.cpp:857 > + if (m_client.base.version <= 3 || !m_client.getContextMenuFromProposedMenuAsync) How about: m_client.base.version < 4 It reads better, I think, referencing the version where the new bits were added. > Source/WebKit2/UIProcess/WebContextMenuListenerProxy.cpp:2 > + * Copyright (C) 2010 Apple Inc. All rights reserved. Update copyright for new files > Source/WebKit2/UIProcess/WebContextMenuListenerProxy.h:2 > + * Copyright (C) 2010 Apple Inc. All rights reserved. Update the copyright date for new files > Source/WebKit2/UIProcess/WebContextMenuListenerProxy.h:27 > +#ifndef WebContextMenuListenerProxy_h > +#define WebContextMenuListenerProxy_h #pragma once > Source/WebKit2/UIProcess/WebContextMenuListenerProxy.h:47 > + void useProposedContextMenuItems(WKArrayRef items); The initial call out to the WK client is "get context menu from proposed menu". So I wouldn't call the returned menu the "proposed menu" as it has assumedly undergone changes. I'd suggest "useContentMenuItems" > Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm:470 > + if (m_contextMenuListener) { > + m_contextMenuListener->invalidate(); > + m_contextMenuListener = nullptr; > + } Very important to invalidate this in the destructor as well.
Created attachment 291855 [details] Patch
Created attachment 292002 [details] Patch
Comment on attachment 292002 [details] Patch Attachment 292002 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/2319358 New failing tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.dataURI.html
Created attachment 292015 [details] Archive of layout-test-results from ews112 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews112 Port: mac-yosemite Platform: Mac OS X 10.10.5
For the iOS build breakage, you'll have to wrap new stuff in #if ENABLE(CONTEXT_MENUS) because they are disabled.
For the linux build breakage, there's an unimplemented virtual function in the base class: virtual void showContextMenuWithItems(const Vector<WebContextMenuItemData>& items) = 0; You'll need to stub it out in WebContextMenuProxyGtk.h and WebContextMenuProxyEfl.h
Created attachment 292080 [details] Patch
Comment on attachment 292080 [details] Patch Clearing flags on attachment: 292080 Committed r207558: <http://trac.webkit.org/changeset/207558>
This seems to be fixed, right?
<rdar://problem/36526665>