+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
#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>
#import <wtf/CurrentTime.h>
#import <wtf/Vector.h>
-SOFT_LINK_FRAMEWORK(UIKit)
-SOFT_LINK_CLASS(UIKit, UIColor)
-
using namespace WebCore;
@interface WebPDFView (Secrets)
[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];
}