WKWebView Print Bug

Originator:murata
Number:rdar://20217859 Date Originated:19-Mar-2015 11:45 AM
Status:Open Resolved:
Product:OS X Product Version:
Classification: Reproducible:
 
Summary:
I tried print a web page with WKWebView.
But,It always becomes the blank page.

Steps to Reproduce:
#1 At Run the following methods:
    [wkwebview print:nil];

#2 At Run the following methods:
    NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:wkwebView printInfo:printInfo];
    [printOperation setPrintPanel:printPanel];
    [printOperation runOperationModalForWindow:[wkwebView window]
                                      delegate:nil
                                didRunSelector:NULL
                                   contextInfo:NULL];

Expected Results:


Actual Results:


Version:
Mac OS X 10.10.2

Notes:
I know the traditional WebView has following method/property for printing.

- (void)webView:(WebView *)sender printFrameView:(WebFrameView *)frameView
@property (nonatomic, readonly, strong) WebFrame *mainFrame;

If corresponding method/property are available on WKWebview, it might help but I can’t find it in WKWebView.

Also, the traditional WebView has the following method.

- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element
    defaultMenuItems:(NSArray *)defaultMenuItems

In a similar fashion, can I add "print" menu item on the context menu of WKWebView?

Configuration:
MacBook Pro (Retina, 13-inch, Late 2013)


Attachments:
'01.png' and '02.png' were successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!