[iOS] Let PDFHostViewController specify the background color to use for WKPDFView
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2019 01:22:19 +0000 (01:22 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Apr 2019 01:22:19 +0000 (01:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196785
<rdar://problem/48240051>

Reviewed by Tim Horton.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_initWithFrame:webView:mimeType:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKPDFView.mm

index 807cf0b..9f00c64 100644 (file)
@@ -1,3 +1,14 @@
+2019-04-10  Andy Estes  <aestes@apple.com>
+
+        [iOS] Let PDFHostViewController specify the background color to use for WKPDFView
+        https://bugs.webkit.org/show_bug.cgi?id=196785
+        <rdar://problem/48240051>
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/ios/WKPDFView.mm:
+        (-[WKPDFView web_initWithFrame:webView:mimeType:]):
+
 2019-04-10  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, rolling out r244146.
index af2acb5..d2f4ff3 100644 (file)
     if (!(self = [super initWithFrame:frame webView:webView]))
         return nil;
 
-    self.backgroundColor = UIColor.grayColor;
-    webView.scrollView.backgroundColor = UIColor.grayColor;
+#if USE(PDFKIT_BACKGROUND_COLOR)
+    UIColor *backgroundColor = PDFHostViewController.backgroundColor;
+#else
+    UIColor *backgroundColor = UIColor.grayColor;
+#endif
+    self.backgroundColor = backgroundColor;
+    webView.scrollView.backgroundColor = backgroundColor;
 
     _keyboardScrollingAnimator = adoptNS([[WKKeyboardScrollViewAnimator alloc] initWithScrollView:webView.scrollView]);