Bug 178351 - Add a _WKThumbnailView initializer with a WKWebView
Summary: Add a _WKThumbnailView initializer with a WKWebView
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-16 11:14 PDT by Alex Christensen
Modified: 2017-10-16 14:34 PDT (History)
2 users (show)

See Also:


Attachments
Patch (7.07 KB, patch)
2017-10-16 11:15 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (7.94 KB, patch)
2017-10-16 14:32 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2017-10-16 11:14:24 PDT
Add a _WKThumbnailView initializer with a WKWebView
Comment 1 Alex Christensen 2017-10-16 11:15:22 PDT
Created attachment 323912 [details]
Patch
Comment 2 Tim Horton 2017-10-16 13:53:03 PDT
Comment on attachment 323912 [details]
Patch

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

> Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.mm:86
> +- (instancetype)initWithFrame:(NSRect)frame fromWKWebView:(WKWebView *)webView

I would also override initWithFrame, put the common things in there, and call self instead of super in each of these, to reduce duplication.

> Source/WebKit/UIProcess/API/Cocoa/_WKThumbnailView.mm:141
> +        if (_wkView) {

This would all be muuuuuch neater with a WKThumbnailableView (or WKThumbnailViewDelegate, or...) protocol.
Comment 3 Alex Christensen 2017-10-16 14:32:51 PDT
Created attachment 323942 [details]
Patch
Comment 4 Alex Christensen 2017-10-16 14:33:33 PDT
http://trac.webkit.org/r223439
Comment 5 Alex Christensen 2017-10-16 14:34:20 PDT
> This would all be muuuuuch neater with a WKThumbnailableView (or
> WKThumbnailViewDelegate, or...) protocol.

I agree.  I think it would be even cleaner if we just quickly got rid of the uses of WKView.
Comment 6 Radar WebKit Bug Importer 2017-10-16 14:34:29 PDT
<rdar://problem/35015188>