Bug 138370

Summary: Use a web view for Quick Look in action menus
Product: WebKit Reporter: Conrad Shultz <conrad_shultz>
Component: WebKit2Assignee: Conrad Shultz <conrad_shultz>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bdakin, commit-queue, conrad_shultz, mitz, sam, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Conrad Shultz 2014-11-04 13:50:47 PST
WebKit should manage its own view for the Quick Look menu item.
Comment 1 Radar WebKit Bug Importer 2014-11-04 13:54:17 PST
<rdar://problem/18871842>
Comment 2 Conrad Shultz 2014-11-04 14:23:00 PST
Created attachment 240948 [details]
Patch
Comment 3 Anders Carlsson 2014-11-04 14:53:15 PST
Comment on attachment 240948 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:70
> +@interface _WKPagePreviewViewController : NSViewController {

This does not be prefixed by an underscore since it's an internal class.
Comment 4 Tim Horton 2014-11-04 15:02:55 PST
Comment on attachment 240948 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:71
> +    @private;

don't think that semicolon belongs, does it?

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:91
> +    _preferredSize = NSMakeSize(320, 568);

Where do these crazy numbers come from!

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:223
> +    NSPopover *popover = [[NSPopover alloc] init];

is the memory management of popover correct?
Comment 5 Conrad Shultz 2014-11-04 15:07:47 PST
(In reply to comment #3)
> Comment on attachment 240948 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=240948&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:70
> > +@interface _WKPagePreviewViewController : NSViewController {
> 
> This does not be prefixed by an underscore since it's an internal class.

Removed.
Comment 6 Conrad Shultz 2014-11-04 15:18:59 PST
(In reply to comment #4)
> Comment on attachment 240948 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=240948&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:71
> > +    @private;
> 
> don't think that semicolon belongs, does it?

Nope, not sure how that snuck in.

> 
> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:91
> > +    _preferredSize = NSMakeSize(320, 568);
> 
> Where do these crazy numbers come from!

"somewhat arbitrary" = "iPhone 5 screen size"; I'll add that to the ChangeLog.

> 
> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:223
> > +    NSPopover *popover = [[NSPopover alloc] init];
> 
> is the memory management of popover correct?

No, that should use RetainPtr too.

New patch coming.
Comment 7 Conrad Shultz 2014-11-04 15:22:13 PST
Created attachment 240959 [details]
Patch
Comment 8 Conrad Shultz 2014-11-04 15:23:18 PST
Created attachment 240961 [details]
Patch
Comment 9 Anders Carlsson 2014-11-04 15:39:36 PST
Comment on attachment 240961 [details]
Patch

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

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:71
> +    @private

I don't think this needs to be indented.

> Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:77
> +@property (nonatomic, readonly) NSURL *url;
> +@property (nonatomic) NSSize preferredSize;

I think these can just be ivars, they don't need to be properties.
Comment 10 Conrad Shultz 2014-11-04 15:49:55 PST
(In reply to comment #9)
> Comment on attachment 240961 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=240961&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:71
> > +    @private
> 
> I don't think this needs to be indented.

Fixed.

> 
> > Source/WebKit2/UIProcess/mac/WKActionMenuController.mm:77
> > +@property (nonatomic, readonly) NSURL *url;
> > +@property (nonatomic) NSSize preferredSize;
> 
> I think these can just be ivars, they don't need to be properties.

It feels really strange to me to prefer direct ivar access, but I'll post a new version doing so.
Comment 11 Conrad Shultz 2014-11-04 15:52:13 PST
Created attachment 240971 [details]
Patch
Comment 12 WebKit Commit Bot 2014-11-04 16:35:24 PST
Comment on attachment 240971 [details]
Patch

Clearing flags on attachment: 240971

Committed r175589: <http://trac.webkit.org/changeset/175589>
Comment 13 WebKit Commit Bot 2014-11-04 16:35:27 PST
All reviewed patches have been landed.  Closing bug.
Comment 14 Tim Horton 2014-11-04 17:48:53 PST
Build fix in http://trac.webkit.org/changeset/175591