RESOLVED FIXED 154995
Add a mechanism to customize the long press action
https://bugs.webkit.org/show_bug.cgi?id=154995
Summary Add a mechanism to customize the long press action
Enrica Casucci
Reported 2016-03-03 16:55:12 PST
We need a new private delegate method to allow clients to customize the sheet displayed on long press. rdar://problem/24823732
Attachments
Patch (15.69 KB, patch)
2016-03-03 17:10 PST, Enrica Casucci
thorton: review+
Enrica Casucci
Comment 1 2016-03-03 17:10:47 PST
WebKit Commit Bot
Comment 2 2016-03-03 17:13:10 PST
Attachment 272803 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:42: Place brace on its own line for function definitions. [whitespace/braces] [4] ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:284: The parameter name "]" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:400: The parameter name "]" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 3 in 12 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tim Horton
Comment 3 2016-03-04 11:03:30 PST
Comment on attachment 272803 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272803&action=review > Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:47 > +typedef NS_OPTIONS(NSUInteger, WKElementType) { > + WKElementTypeLink, > + WKElementTypeImage, > + WKElementTypeAttachment > +} WK_ENUM_AVAILABLE(NA, WK_IOS_TBA); > + I think you don't need this anymore? > Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:1091 > + [uiDelegate _webView:_webView showCustomSheetForElement:[[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL URLWithString:_positionInformation.url] location:_positionInformation.point title:_positionInformation.title rect:_positionInformation.bounds image:nil]]; Shouldn't this use _web_URLWithWTFString? > Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:3566 > + [UIApp _cancelAllTouches]; Yikes. > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:2251 > + info.title = attachment.attachmentTitle(); We never want to set isSelectable?
Enrica Casucci
Comment 4 2016-03-04 15:47:22 PST
(In reply to comment #3) > Comment on attachment 272803 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=272803&action=review > > > Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:47 > > +typedef NS_OPTIONS(NSUInteger, WKElementType) { > > + WKElementTypeLink, > > + WKElementTypeImage, > > + WKElementTypeAttachment > > +} WK_ENUM_AVAILABLE(NA, WK_IOS_TBA); > > + > > I think you don't need this anymore? > My bad. I'll remove it. > > Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm:1091 > > + [uiDelegate _webView:_webView showCustomSheetForElement:[[_WKActivatedElementInfo alloc] _initWithType:_WKActivatedElementTypeAttachment URL:[NSURL URLWithString:_positionInformation.url] location:_positionInformation.point title:_positionInformation.title rect:_positionInformation.bounds image:nil]]; > > Shouldn't this use _web_URLWithWTFString? > Yes. > We never want to set isSelectable? Not when handling long press.
Enrica Casucci
Comment 5 2016-03-04 15:56:52 PST
Committed revision 197596.
Simon Fraser (smfr)
Comment 6 2016-03-04 20:58:01 PST
Comment on attachment 272803 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=272803&action=review > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:2253 > + info.url = downcast<HTMLAttachmentElement>(*hitNode).file()->path(); This is confusing. Is it a URL or a path?
Note You need to log in before you can comment on or make changes to this bug.