Title: [174282] trunk/Source/WebKit/ios
- Revision
- 174282
- Author
- [email protected]
- Date
- 2014-10-03 13:26:41 -0700 (Fri, 03 Oct 2014)
Log Message
REGRESSION (r173265): UIWebView PDF loading is completely broken
https://bugs.webkit.org/show_bug.cgi?id=137386
<rdar://problem/18524717>
Reviewed by David Kilzer.
* WebView/WebPDFViewPlaceholder.h:
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder layout]):
(-[WebPDFViewPlaceholder finishedLoadingWithDataSource:]):
Restore important code that creates the CGDataProvider and sets _didFinishLoad
and calls _doPostLoadOrUnlockTasks after finishing a load, which was haphazardly
removed in the aforementioned revision.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ios/ChangeLog (174281 => 174282)
--- trunk/Source/WebKit/ios/ChangeLog 2014-10-03 20:20:20 UTC (rev 174281)
+++ trunk/Source/WebKit/ios/ChangeLog 2014-10-03 20:26:41 UTC (rev 174282)
@@ -1,3 +1,19 @@
+2014-10-03 Tim Horton <[email protected]>
+
+ REGRESSION (r173265): UIWebView PDF loading is completely broken
+ https://bugs.webkit.org/show_bug.cgi?id=137386
+ <rdar://problem/18524717>
+
+ Reviewed by David Kilzer.
+
+ * WebView/WebPDFViewPlaceholder.h:
+ * WebView/WebPDFViewPlaceholder.mm:
+ (-[WebPDFViewPlaceholder layout]):
+ (-[WebPDFViewPlaceholder finishedLoadingWithDataSource:]):
+ Restore important code that creates the CGDataProvider and sets _didFinishLoad
+ and calls _doPostLoadOrUnlockTasks after finishing a load, which was haphazardly
+ removed in the aforementioned revision.
+
2014-10-01 Christophe Dumez <[email protected]>
Have is<>(T*) function do a null check on the pointer argument
Modified: trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.h (174281 => 174282)
--- trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.h 2014-10-03 20:20:20 UTC (rev 174281)
+++ trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.h 2014-10-03 20:26:41 UTC (rev 174282)
@@ -46,7 +46,7 @@
NSObject<WebPDFViewPlaceholderDelegate> *_delegate;
- BOOL _didFinishLoadAndMemoryMap;
+ BOOL _didFinishLoad;
CGSize _containerSize;
}
Modified: trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm (174281 => 174282)
--- trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm 2014-10-03 20:20:20 UTC (rev 174281)
+++ trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm 2014-10-03 20:26:41 UTC (rev 174282)
@@ -220,7 +220,7 @@
- (void)layout
{
- if (!_didFinishLoadAndMemoryMap)
+ if (!_didFinishLoad)
return;
if (self.pageRects)
@@ -276,6 +276,17 @@
- (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
{
[self dataSourceUpdated:dataSource];
+
+ _didFinishLoad = YES;
+ CGDataProviderRef provider = CGDataProviderCreateWithCFData((CFDataRef)[dataSource data]);
+ if (!provider)
+ return;
+
+ _document = CGPDFDocumentCreateWithProvider(provider);
+
+ CGDataProviderRelease(provider);
+
+ [self _doPostLoadOrUnlockTasks];
}
- (BOOL)canProvideDocumentSource
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes