Title: [104663] trunk/Source/WebKit2
- Revision
- 104663
- Author
- [email protected]
- Date
- 2012-01-10 20:50:17 -0800 (Tue, 10 Jan 2012)
Log Message
REGRESSION (r104377): All pages print blank on Snow Leopard
<http://webkit.org/b/75879> / <rdar://problem/10674335>
We need to explicitly load PDFKit.framework before using PDFDocument and friends.
On SnowLeopard the framework is not necessarily loaded by anything else before we
print, which would lead to us failing to allocate the PDFDocument that we use for
drawing the content from the web process.
Reviewed by Dan Bernstein.
* UIProcess/API/mac/WKPrintingView.mm:
(pdfKitFrameworkPath): Construct the path to the PDFKit framework.
(classFromPDFKit): Ensure that the PDFKit framework is loaded, and then retrieve the
given class from it.
(pdfAnnotationLinkClass): ASSERT that we found the class.
(pdfDocumentClass): Ditto.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (104662 => 104663)
--- trunk/Source/WebKit2/ChangeLog 2012-01-11 03:52:33 UTC (rev 104662)
+++ trunk/Source/WebKit2/ChangeLog 2012-01-11 04:50:17 UTC (rev 104663)
@@ -1,3 +1,22 @@
+2012-01-10 Mark Rowe <[email protected]>
+
+ REGRESSION (r104377): All pages print blank on Snow Leopard
+ <http://webkit.org/b/75879> / <rdar://problem/10674335>
+
+ We need to explicitly load PDFKit.framework before using PDFDocument and friends.
+ On SnowLeopard the framework is not necessarily loaded by anything else before we
+ print, which would lead to us failing to allocate the PDFDocument that we use for
+ drawing the content from the web process.
+
+ Reviewed by Dan Bernstein.
+
+ * UIProcess/API/mac/WKPrintingView.mm:
+ (pdfKitFrameworkPath): Construct the path to the PDFKit framework.
+ (classFromPDFKit): Ensure that the PDFKit framework is loaded, and then retrieve the
+ given class from it.
+ (pdfAnnotationLinkClass): ASSERT that we found the class.
+ (pdfDocumentClass): Ditto.
+
2012-01-10 Chris Marrin <[email protected]>
Wrapped allowedCompositingTriggers in ACCELERATED_COMPOSITING ifdef to make non-accelerated builds work
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm (104662 => 104663)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm 2012-01-11 03:52:33 UTC (rev 104662)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm 2012-01-11 04:50:17 UTC (rev 104663)
@@ -411,15 +411,30 @@
return 0; // Invalid page number.
}
+static NSString *pdfKitFrameworkPath()
+{
+ NSString *systemLibraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSSystemDomainMask, NO) objectAtIndex:0];
+ return [systemLibraryPath stringByAppendingPathComponent:@"Frameworks/Quartz.framework/Frameworks/PDFKit.framework"];
+}
+
+static Class classFromPDFKit(NSString *className)
+{
+ static NSBundle *pdfKitBundle = [NSBundle bundleWithPath:pdfKitFrameworkPath()];
+ [pdfKitBundle load];
+ return [pdfKitBundle classNamed:className];
+}
+
static Class pdfAnnotationLinkClass()
{
- static Class pdfAnnotationLinkClass = NSClassFromString(@"PDFAnnotationLink");
+ static Class pdfAnnotationLinkClass = classFromPDFKit(@"PDFAnnotationLink");
+ ASSERT(pdfAnnotationLinkClass);
return pdfAnnotationLinkClass;
}
static Class pdfDocumentClass()
{
- static Class pdfDocumentClass = NSClassFromString(@"PDFDocument");
+ static Class pdfDocumentClass = classFromPDFKit(@"PDFDocument");
+ ASSERT(pdfDocumentClass);
return pdfDocumentClass;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes