Bug 137792

Summary: [iOS] Capture WKActionSheetAssistant's interaction with WKContentView in a @protocol
Product: WebKit Reporter: Andy Estes <aestes>
Component: New BugsAssignee: Andy Estes <aestes>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, enrica, mitz, thorton
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch mitz: review+

Description Andy Estes 2014-10-16 14:50:29 PDT
[iOS] Capture WKActionSheetAssistant's interaction with WKContentView in a @protocol
Comment 1 Andy Estes 2014-10-16 14:51:01 PDT
rdar://problem/18334903
Comment 2 Andy Estes 2014-10-16 14:52:30 PDT
Created attachment 239975 [details]
Patch
Comment 3 WebKit Commit Bot 2014-10-16 14:55:15 PDT
Attachment 239975 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.mm:94:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.mm:100:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.mm:106:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.mm:112:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 4 in 9 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Andy Estes 2014-10-18 10:05:54 PDT
The gtk-wk2 failure was due to the EWS bot running out of disk space.
Comment 5 Andy Estes 2014-10-19 17:24:33 PDT
An alternate approach I considered here was to have WKContentView conform to WKWebViewContentProvider and then have WKActionSheetAssistant take an id<WKActionSheetAssistant>. Unfortunately, the amount of refactoring needed to make WKContentView conform to WKWebViewContentProvider exceeded what was necessary for this patch (unless I just added stubs to WKContentView, which didn't seem right).
Comment 6 Andy Estes 2014-10-19 17:26:21 PDT
s/id<WKActionSheetAssistant>/id<WKWebViewContentProvider>/
Comment 7 Tim Horton 2014-10-20 00:26:46 PDT
Comment on attachment 239975 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=239975&action=review

> Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.mm:202
> +    _interactionSheet = adoptNS([WKActionSheet new]);

new :(
Comment 8 Andy Estes 2014-10-20 09:28:14 PDT
Committed r174885: <http://trac.webkit.org/changeset/174885>
Comment 9 mitz 2014-11-04 09:36:43 PST
Comment on attachment 239975 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=239975&action=review

> Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.h:52
> +@protocol WKActionSheetAssistantDelegate
> +@required
> +@property (nonatomic, readonly) const WebKit::InteractionInformationAtPosition& positionInformation;
> +- (void)updatePositionInformation;
> +- (void)performAction:(WebKit::SheetAction)action;
> +- (void)openElementAtLocation:(CGPoint)location;
> +- (RetainPtr<NSArray>)actionsForElement:(_WKActivatedElementInfo *)element defaultActions:(RetainPtr<NSArray>)defaultActions;
> +- (void)startInteractionWithElement:(_WKActivatedElementInfo *)element;
> +- (void)stopInteraction;
> +@end

All methods in a delegate protocol must have one parameter which is the delegating object (in this case, the WKActionSheetAssistant). None of these do!
Comment 10 mitz 2014-11-04 09:50:51 PST
(In reply to comment #9)
> All methods in a delegate protocol must have one parameter which is the
> delegating object (in this case, the WKActionSheetAssistant).

Oops, this may read differently than intended. Instead of “have one parameter” I should have said “include one parameter”, or simply “include the delegating object as one of the parameters”.
Comment 11 Andy Estes 2014-11-04 12:22:29 PST
Reopening to attach new patch.
Comment 12 Andy Estes 2014-11-04 12:22:30 PST
Created attachment 240941 [details]
Patch
Comment 13 WebKit Commit Bot 2014-11-04 12:24:44 PST
Attachment 240941 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.mm:94:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.mm:100:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.mm:106:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.mm:112:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 4 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Andy Estes 2014-11-04 13:44:05 PST
Committed r175577: <http://trac.webkit.org/changeset/175577>