Bug 129117 - Add magnification and swiping properties to WKWebView
Summary: Add magnification and swiping properties to WKWebView
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-20 13:18 PST by Tim Horton
Modified: 2014-02-20 15:41 PST (History)
2 users (show)

See Also:


Attachments
patch (5.66 KB, patch)
2014-02-20 13:22 PST, Tim Horton
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2014-02-20 13:18:08 PST
Copied from WKView[IOS].
Comment 1 Tim Horton 2014-02-20 13:22:49 PST
Created attachment 224793 [details]
patch
Comment 2 mitz 2014-02-20 14:40:15 PST
Comment on attachment 224793 [details]
patch

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

r=me if you address the comments.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:126
> +@property (nonatomic) double magnification;

This should be a CGFloat.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:128
> +- (void)setMagnification:(double)magnification centeredAtPoint:(NSPoint)point;

magnification should be a CGFloat.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:470
> +- (void)setMagnification:(double)magnification
> +{
> +    [_wkView setMagnification:magnification];
> +}

Who uses this? And how?

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:669
> +    } else
> +        _gestureController = nullptr;

This branch is taken when allowsBackForwardNavigationGestures is YES and _gestureController is not null. I don’t think you want to do that.
Comment 3 Tim Horton 2014-02-20 15:10:16 PST
(In reply to comment #2)
> (From update of attachment 224793 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=224793&action=review
> 
> r=me if you address the comments.
> 
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h:126
> > +@property (nonatomic) double magnification;
> 
> This should be a CGFloat.

OK. I’m going to use CGPoint too at andersca’s suggestion.

> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:470
> > +- (void)setMagnification:(double)magnification
> > +{
> > +    [_wkView setMagnification:magnification];
> > +}
> 
> Who uses this? And how?

I was just matching NSScrollView’s behavior.

> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:669
> > +    } else
> > +        _gestureController = nullptr;
> 
> This branch is taken when allowsBackForwardNavigationGestures is YES and _gestureController is not null. I don’t think you want to do that.

Indeed.
Comment 4 Tim Horton 2014-02-20 15:41:14 PST
http://trac.webkit.org/changeset/164455