Title: [251673] trunk
Revision
251673
Author
[email protected]
Date
2019-10-28 14:42:43 -0700 (Mon, 28 Oct 2019)

Log Message

Expose _printOperationWithPrintInfo: SPI as API
<rdar://problem/36557179> and https://bugs.webkit.org/show_bug.cgi?id=203496

Reviewed by Andy Estes.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView printOperationWithPrintInfo:]):
(-[WKWebView _printOperationWithPrintInfo:]):

Tools:

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController printWebView:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (251672 => 251673)


--- trunk/Source/WebKit/ChangeLog	2019-10-28 21:38:26 UTC (rev 251672)
+++ trunk/Source/WebKit/ChangeLog	2019-10-28 21:42:43 UTC (rev 251673)
@@ -1,3 +1,15 @@
+2019-10-28  Brady Eidson  <[email protected]>
+
+        Expose _printOperationWithPrintInfo: SPI as API
+        <rdar://problem/36557179> and https://bugs.webkit.org/show_bug.cgi?id=203496
+
+        Reviewed by Andy Estes.
+
+        * UIProcess/API/Cocoa/WKWebView.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView printOperationWithPrintInfo:]):
+        (-[WKWebView _printOperationWithPrintInfo:]):
+
 2019-10-28  Kate Cheney  <[email protected]>
 
         Layout Test http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html is a flaky failure

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.h (251672 => 251673)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.h	2019-10-28 21:38:26 UTC (rev 251672)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.h	2019-10-28 21:42:43 UTC (rev 251673)
@@ -300,6 +300,12 @@
  */
 + (BOOL)handlesURLScheme:(NSString *)urlScheme WK_API_AVAILABLE(macos(10.13), ios(11.0));
 
+#if !TARGET_OS_IPHONE
+/* @abstract Returns an NSPrintOperation object configured to print the contents of this WKWebView
+@param printInfo The print info object used to configure the resulting print operation.
+*/
+- (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo WK_API_AVAILABLE(macos(WK_MAC_TBA));
+#endif
 @end
 
 #if !TARGET_OS_IPHONE

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (251672 => 251673)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-10-28 21:38:26 UTC (rev 251672)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-10-28 21:42:43 UTC (rev 251673)
@@ -4633,6 +4633,13 @@
 
 #endif // ENABLE(DRAG_SUPPORT)
 
+- (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo
+{
+    if (auto webFrameProxy = _page->mainFrame())
+        return _impl->printOperationWithPrintInfo(printInfo, *webFrameProxy);
+    return nil;
+}
+
 #endif // PLATFORM(MAC)
 
 #if HAVE(TOUCH_BAR)
@@ -6745,9 +6752,7 @@
 
 - (NSPrintOperation *)_printOperationWithPrintInfo:(NSPrintInfo *)printInfo
 {
-    if (auto webFrameProxy = _page->mainFrame())
-        return _impl->printOperationWithPrintInfo(printInfo, *webFrameProxy);
-    return nil;
+    return [self printOperationWithPrintInfo:printInfo];
 }
 
 - (NSPrintOperation *)_printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(_WKFrameHandle *)frameHandle

Modified: trunk/Tools/ChangeLog (251672 => 251673)


--- trunk/Tools/ChangeLog	2019-10-28 21:38:26 UTC (rev 251672)
+++ trunk/Tools/ChangeLog	2019-10-28 21:42:43 UTC (rev 251673)
@@ -1,3 +1,13 @@
+2019-10-28  Brady Eidson  <[email protected]>
+
+        Expose _printOperationWithPrintInfo: SPI as API
+        <rdar://problem/36557179> and https://bugs.webkit.org/show_bug.cgi?id=203496
+
+        Reviewed by Andy Estes.
+
+        * MiniBrowser/mac/WK2BrowserWindowController.m:
+        (-[WK2BrowserWindowController printWebView:]):
+
 2019-10-28  Jonathan Bedard  <[email protected]>
 
         results.webkit.org: Show results which are missing expectations

Modified: trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m (251672 => 251673)


--- trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m	2019-10-28 21:38:26 UTC (rev 251672)
+++ trunk/Tools/MiniBrowser/mac/WK2BrowserWindowController.m	2019-10-28 21:42:43 UTC (rev 251673)
@@ -644,7 +644,7 @@
 
 - (IBAction)printWebView:(id)sender
 {
-    [[_webView _printOperationWithPrintInfo:[NSPrintInfo sharedPrintInfo]] runOperationModalForWindow:self.window delegate:nil didRunSelector:nil contextInfo:nil];
+    [[_webView printOperationWithPrintInfo:[NSPrintInfo sharedPrintInfo]] runOperationModalForWindow:self.window delegate:nil didRunSelector:nil contextInfo:nil];
 }
 
 #pragma mark WKNavigationDelegate
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to