REGRESSION (r165896): UIWebView PDFs have a forced black background
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Oct 2014 20:28:04 +0000 (20:28 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Oct 2014 20:28:04 +0000 (20:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137387
<rdar://problem/17948411>

Reviewed by David Kilzer.

* WebView/WebPDFViewPlaceholder.h:
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder layout]):
Remove an ill-advised attempt to force the PDF background color from WebKit.
The idea was that we would maintain Safari's black background except if there
were no pages in the PDF, in which case we would use white instead to avoid
having an all-black view. However, this broke clients who didn't want a black
background, because we were now forcing it to black. Also, we don't need to
maintain the black color in Safari because it doesn't use WebPDFViewPlaceholder anymore.
This wasn't an important part of the patch, in any case.

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

Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebView/WebPDFViewPlaceholder.h
Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm

index 19028be381d7b1b3b06387990f0da3b6d1d0caf5..360081636e0389a4f82273c550d430bd89ea6de2 100644 (file)
@@ -1,3 +1,22 @@
+2014-10-03  Tim Horton  <timothy_horton@apple.com>
+
+        REGRESSION (r165896): UIWebView PDFs have a forced black background
+        https://bugs.webkit.org/show_bug.cgi?id=137387
+        <rdar://problem/17948411>
+
+        Reviewed by David Kilzer.
+
+        * WebView/WebPDFViewPlaceholder.h:
+        * WebView/WebPDFViewPlaceholder.mm:
+        (-[WebPDFViewPlaceholder layout]):
+        Remove an ill-advised attempt to force the PDF background color from WebKit.
+        The idea was that we would maintain Safari's black background except if there
+        were no pages in the PDF, in which case we would use white instead to avoid
+        having an all-black view. However, this broke clients who didn't want a black
+        background, because we were now forcing it to black. Also, we don't need to
+        maintain the black color in Safari because it doesn't use WebPDFViewPlaceholder anymore.
+        This wasn't an important part of the patch, in any case.
+
 2014-10-03  Tim Horton  <timothy_horton@apple.com>
 
         REGRESSION (r173265): UIWebView PDF loading is completely broken
index 85e5f6d515b39ae78a554518c2fec28de7f66487..eef53b42bad44bc68096f0b556701056c6774c6f 100644 (file)
  */
 - (CGPDFDocumentRef)cgPDFDocument;
 
-- (void)setBackgroundColor:(UIColor *)backgroundColor;
-
 @end
 
 #endif /* TARGET_OS_IPHONE */
index 568c5fcdd5050812bb7f0c5ee3c3362df1255d34..298ef5b95beeeb12c74bf915df7deaca4346a4ad 100644 (file)
@@ -32,7 +32,6 @@
 #import <JavaScriptCore/JSContextRef.h>
 #import <JavaScriptCore/JSStringRef.h>
 #import <JavaScriptCore/JSStringRefCF.h>
-#import <UIKit/UIKit.h>
 #import <WebCore/DataTransfer.h>
 #import <WebCore/EventHandler.h>
 #import <WebCore/EventNames.h>
@@ -53,9 +52,6 @@
 #import <wtf/CurrentTime.h>
 #import <wtf/Vector.h>
 
-SOFT_LINK_FRAMEWORK(UIKit)
-SOFT_LINK_CLASS(UIKit, UIColor)
-
 using namespace WebCore;
 
 @interface WebPDFView (Secrets)
@@ -230,13 +226,6 @@ static const float PAGE_HEIGHT_INSET = 4.0f * 2.0f;
 
     [self setBoundsSize:boundingSize];
 
-    if ([self.delegate respondsToSelector:@selector(setBackgroundColor:)]) {
-        if (CGSizeEqualToSize(boundingSize, CGSizeZero))
-            [self.delegate setBackgroundColor:[getUIColorClass() whiteColor]];
-        else
-            [self.delegate setBackgroundColor:[getUIColorClass() blackColor]];
-    }
-
     _didCompleteLayout = YES;
     [self _notifyDidCompleteLayout];
 }