Title: [105097] branches/safari-534.54-branch/Source/WebKit2

Diff

Modified: branches/safari-534.54-branch/Source/WebKit2/ChangeLog (105096 => 105097)


--- branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-01-16 23:38:30 UTC (rev 105096)
+++ branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-01-16 23:38:37 UTC (rev 105097)
@@ -1,5 +1,28 @@
 2012-01-16  Mark Rowe  <[email protected]>
 
+        Merge r104663.
+
+    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-16  Mark Rowe  <[email protected]>
+
         Merge r104377.
 
     2012-01-06  Mark Rowe  <[email protected]>

Modified: branches/safari-534.54-branch/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm (105096 => 105097)


--- branches/safari-534.54-branch/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm	2012-01-16 23:38:30 UTC (rev 105096)
+++ branches/safari-534.54-branch/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm	2012-01-16 23:38:37 UTC (rev 105097)
@@ -398,15 +398,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

Reply via email to