WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
150606
Stub out more of the context menu SPI
https://bugs.webkit.org/show_bug.cgi?id=150606
Summary
Stub out more of the context menu SPI
Anders Carlsson
Reported
2015-10-27 14:39:45 PDT
Stub out more of the context menu SPI
Attachments
Patch
(47.36 KB, patch)
2015-10-27 14:42 PDT
,
Anders Carlsson
no flags
Details
Formatted Diff
Diff
Patch
(47.63 KB, patch)
2015-10-27 15:18 PDT
,
Anders Carlsson
mitz: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Anders Carlsson
Comment 1
2015-10-27 14:42:01 PDT
Created
attachment 264162
[details]
Patch
Anders Carlsson
Comment 2
2015-10-27 15:18:56 PDT
Created
attachment 264166
[details]
Patch
mitz
Comment 3
2015-10-28 10:54:02 PDT
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.
Anders Carlsson
Comment 4
2015-10-28 11:02:51 PDT
(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.
Anders Carlsson
Comment 5
2015-10-28 12:14:03 PDT
Committed
r191685
: <
http://trac.webkit.org/changeset/191685
>
Anders Carlsson
Comment 6
2015-10-28 15:53:03 PDT
Committed
r191698
: <
http://trac.webkit.org/changeset/191698
>
Stefan Arentz
Comment 7
2015-10-29 07:47:23 PDT
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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug