[Webkit-unassigned] [Bug 155383] Make preview inline navigation work API
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Mar 12 14:11:41 PST 2016
https://bugs.webkit.org/show_bug.cgi?id=155383
--- Comment #6 from Beth Dakin <bdakin at apple.com> ---
Thanks Dan!!
(In reply to comment #4)
> Comment on attachment 273784 [details]
> Patch
>
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=273784&action=review
>
> r- because this breaks the Mac build. Some more comments below.
>
> > Source/WebKit2/ChangeLog:16
> > + _WKPreviewActionItem is now WKPreviewActionItem, but the _WKPreviewAction
> > + class is still a private implementation detail, so it still has an underscore
> > + even though the filenames do not.
>
> If itâs an *internal* implementation detail, i.e, the class isnât available
> even to SPI clients and isnât exposed in a framework header (which I think
> is the case or at least should be the case), then per our convention it
> should *not* be underscore-prefixed.
>
Oops! I fixed this.
> > Source/WebKit2/ChangeLog:19
> > + nowWKPreviewActionItemIdentifiers.h/mm and all the the identifiers have been
>
> nowWK
>
Fixed.
> > Source/WebKit2/UIProcess/API/Cocoa/WKElementInfoInternal.h:39
> > +#endif // WK_API_ENABLED
>
> I think we normally donât // WK_API_ENABLED.
>
I found 173 occurrences of '// WK_API_ENABLED' when I searched for it in the WebKit2 xcoeproj, so I left it in for now. :-O
> > Source/WebKit2/UIProcess/API/Cocoa/WKPreviewActionItemInternal.h:32
> > + at interface _WKPreviewAction : UIPreviewAction <NSCopying, WKPreviewActionItem>
>
> So the underscore should go.
>
Gone!
> Not new, but youâre claiming NSCopying conformance here but I donât see that
> class overrides -copyWithZone:, so at the very least it fails to copy the
> identifier (and thatâs assuming UIPreviewAction is copyable, in which case,
> thereâs no need to declare that its subclass is NSCopying-conformant).
>
I haven't fixed this yet since there is a new bug filed about it. Also since it will be easier to review that bit in the context of a smaller patch.
> > Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegate.h:150
> > +- (BOOL)webView:(WKWebView *)webView shouldPreviewElement:(WKPreviewElementInfo *)elementInfo WK_AVAILABLE(NA, WK_IOS_TBA);
> > +
> > +/*! @abstract Allows your app to provide a custom view controller to show when the given element is peeked.
> > + @param webView The web view invoking the delegate method.
> > + @param elementInfo The elementInfo for the element the user is peeking.
> > + @param defaultActions An array of the actions that WebKit would use as previewActionItems for this element by
> > + default. These actions would be used if allowsLinkPreview is YES but these delegate methods have not been
> > + implemented, or if this delegate method returns nil.
> > + @discussion Returning a view controller will result in that view controller being displayed as a peek preview.
> > + To use the defaultActions, your app is responsible for returning whichever of those actions it wants in your
> > + view controller's implementation of -previewActionItems.
> > +
> > + Returning nil will result in WebKit's default preview behavior. webView:commitPreviewingViewController: will only be invoked
> > + if a non-nil view controller was returned.
> > + */
> > +- (nullable UIViewController *)webView:(WKWebView *)webView previewingViewControllerForElement:(WKPreviewElementInfo *)elementInfo defaultActions:(NSArray <id <WKPreviewActionItem>> *)previewActions WK_AVAILABLE(NA, WK_IOS_TBA);
> > +
> > +/*! @abstract Allows your app to pop to the view controller it created.
> > + @param webView The web view invoking the delegate method.
> > + @param previewingViewController The view controller that is being popped.
> > + */
> > +- (void)webView:(WKWebView *)webView commitPreviewingViewController:(UIViewController *)previewingViewController WK_AVAILABLE(NA, WK_IOS_TBA);
>
> These should all be in an #if TARGET_OS_IPHONE block.
Fixed!
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160312/b304335a/attachment.html>
More information about the webkit-unassigned
mailing list