Summary: | Stub out more of the context menu SPI | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||||
Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bdakin, stefan | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Anders Carlsson
2015-10-27 14:39:45 PDT
Created attachment 264162 [details]
Patch
Created attachment 264166 [details]
Patch
Comment on attachment 264166 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=264166&action=review > Source/WebKit2/UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:34 > +WK_CLASS_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA) Should this be available in iOS? Should the entire header be guarded in #if !TARGET_OS_IPHONE? > Source/WebKit2/UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm:33 > +@implementation _WKContextMenuElementInfo > + > +@end Similarly here, perhaps this should be omitted entirely on non-Mac. > Source/WebKit2/UIProcess/API/Cocoa/_WKElementInfo.h:33 > +@interface _WKElementInfo : NSObject <NSCopying>? > Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm:124 > + return [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView contextMenu:menu forElement:contextMenuElementInfo.get()]; Even though the return value is nonnull, does this do something reasonable if the delegate returns nil? Should it? > Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm:383 > + NSLog(@"menu is %@", m_menu.get()); Please remove this. (In reply to comment #3) > Comment on attachment 264166 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=264166&action=review > > > Source/WebKit2/UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:34 > > +WK_CLASS_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA) > > Should this be available in iOS? Should the entire header be guarded in #if > !TARGET_OS_IPHONE? Yes. I'll change it to #if WK_API_ENABLED && !TARGET_OS_IPHONE > > > Source/WebKit2/UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm:33 > > +@implementation _WKContextMenuElementInfo > > + > > +@end > > Similarly here, perhaps this should be omitted entirely on non-Mac. Yes. Changing to #if WK_API_ENABLED && !PLATFORM(IOS) > > > Source/WebKit2/UIProcess/API/Cocoa/_WKElementInfo.h:33 > > +@interface _WKElementInfo : NSObject > > <NSCopying>? Yes. > > > Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm:124 > > + return [(id <WKUIDelegatePrivate>)delegate _webView:m_uiDelegate.m_webView contextMenu:menu forElement:contextMenuElementInfo.get()]; > > Even though the return value is nonnull, does this do something reasonable > if the delegate returns nil? Should it? Returning nil prohibits the menu from being displayed. I don't want to add WK_ASSUME_NONNNULL to WKUIDelegatePrivate.h for now, but I made sure to change the return type to include WK_NULLABLE. > > > Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm:383 > > + NSLog(@"menu is %@", m_menu.get()); > > Please remove this. Committed r191685: <http://trac.webkit.org/changeset/191685> Committed r191698: <http://trac.webkit.org/changeset/191698> This is great. Two questions: * Will this become a public API? * Will this also work for the menu options shown under a 3D Touch Peek? S. |