REGRESSION (r132545): Some PDFs generated by WebKit are blank when viewed in
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 22:57:07 +0000 (22:57 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 22:57:07 +0000 (22:57 +0000)
Adobe Reader
https://bugs.webkit.org/show_bug.cgi?id=120240
-and corresponding-
<rdar://problem/14634453>

Reviewed by Anders Carlsson.

Source/WebCore:

This patch makes it so that we don’t use the infinite rect for the PDF context,
and it adds WebCoreSystemInterface API to find out if the current content is the
PDF context.

* WebCore.exp.in:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::clipOut):
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac:

Hook up new WebSystemInterface API to find out if the current context is the PDF
context.

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2:

Hook up new WebSystemInterface API to find out if the current context is the PDF
context.

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

WebKitLibraries:

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceMountainLion.a:

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceMountainLion.a

index 77f8e7efb85c0e811f5bac1b974e03187de71884..d46a1a65f19bd9ac2c9f1f96dc374d7f8bac1c38 100644 (file)
@@ -1,3 +1,23 @@
+2013-08-23  Beth Dakin  <bdakin@apple.com>
+
+        REGRESSION (r132545): Some PDFs generated by WebKit are blank when viewed in 
+        Adobe Reader
+        https://bugs.webkit.org/show_bug.cgi?id=120240
+        -and corresponding-
+        <rdar://problem/14634453>
+
+        Reviewed by Anders Carlsson.
+
+        This patch makes it so that we don’t use the infinite rect for the PDF context, 
+        and it adds WebCoreSystemInterface API to find out if the current content is the 
+        PDF context. 
+
+        * WebCore.exp.in:
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::clipOut):
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+
 2013-08-23  Eric Carlson  <eric.carlson@apple.com>
 
         [Mac] some track language tags are not recognized
index 8211e38c3c0ac169b8ca03f1f8600a3e53836133..e4513e2173c5a6e6529f216fc8f537d0ac5afd7d 100644 (file)
@@ -1709,6 +1709,7 @@ _hasCaseInsensitiveSuffix
 _stringIsCaseInsensitiveEqualToString
 _suggestedFilenameWithMIMEType
 _wkCGContextGetShouldSmoothFonts
+_wkCGContextIsPDFContext
 _wkCGContextResetClip
 _wkCGPatternCreateWithImageAndTransform
 _wkCTRunGetInitialAdvance
index bc9d9836bd0993045f0f4b8255516b5c85630841..64252f6c275b497d2e90a7e9005b0588d344cc0d 100644 (file)
@@ -838,9 +838,10 @@ void GraphicsContext::clipOut(const IntRect& rect)
 
     // FIXME: Using CGRectInfinite is much faster than getting the clip bounding box. However, due
     // to <rdar://problem/12584492>, CGRectInfinite can't be used with an accelerated context that
-    // has certain transforms that aren't just a translation or a scale.
+    // has certain transforms that aren't just a translation or a scale. And due to <rdar://problem/14634453>
+    // we cannot use it in for a printing context either.
     const AffineTransform& ctm = getCTM();
-    bool canUseCGRectInfinite = !isAcceleratedContext() || (!ctm.b() && !ctm.c());
+    bool canUseCGRectInfinite = !wkCGContextIsPDFContext(platformContext()) && (!isAcceleratedContext() || (!ctm.b() && !ctm.c()));
     CGRect rects[2] = { canUseCGRectInfinite ? CGRectInfinite : CGContextGetClipBoundingBox(platformContext()), rect };
     CGContextBeginPath(platformContext());
     CGContextAddRects(platformContext(), rects, 2);
index 1918693f69fdc36c238b8d1124141c15eb00bec4..c9b4938472e78493c253b78f3fc6b46189ebbf4c 100644 (file)
@@ -202,6 +202,7 @@ extern void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
 extern void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
 extern void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint);
 extern CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
+extern bool (*wkCGContextIsPDFContext)(CGContextRef);
 extern void (*wkSetUpFontCache)();
 extern void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
 extern void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
index 1faf5a9c87985ecc3872ec8a00c09be5881b7fd1..c0df0a6ddc3b2378e04c5279dfa658836f4e01a6 100644 (file)
@@ -92,6 +92,7 @@ void (*wkSetDragImage)(NSImage*, NSPoint offset);
 void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
 void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
 CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
+bool (*wkCGContextIsPDFContext)(CGContextRef);
 void (*wkSetUpFontCache)();
 void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
 void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
index 4c969292c0974de5ea4b380b38dd25666ea2fb49..899abd3e5886bd6316030eff8227a228d55a626c 100644 (file)
@@ -1,3 +1,19 @@
+2013-08-23  Beth Dakin  <bdakin@apple.com>
+
+        REGRESSION (r132545): Some PDFs generated by WebKit are blank when viewed in 
+        Adobe Reader
+        https://bugs.webkit.org/show_bug.cgi?id=120240
+        -and corresponding-
+        <rdar://problem/14634453>
+
+        Reviewed by Anders Carlsson.
+
+        Hook up new WebSystemInterface API to find out if the current context is the PDF 
+        context.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2013-08-20  Pratik Solanki  <psolanki@apple.com>
 
         <https://webkit.org/b/120029> Document::markers() should return a reference
index 0551a6c26d23ffebeb80d261377d7aef3648b7b2..f23113e749f5ea4ca162183c67e78ebc6725ae8b 100644 (file)
@@ -99,6 +99,7 @@ void InitWebCoreSystemInterface(void)
     INIT(SetNSURLConnectionDefersCallbacks);
     INIT(SetNSURLRequestShouldContentSniff);
     INIT(SetPatternPhaseInUserSpace);
+    INIT(CGContextIsPDFContext);
     INIT(GetUserToBaseCTM);
     INIT(SetUpFontCache);
     INIT(SignalCFReadStreamEnd);
index 227b58044030eb029fa8b7722652633f1ac8986d..ccb97921a6836702ea566e9b075dba3194f18a00 100644 (file)
@@ -1,3 +1,19 @@
+2013-08-23  Beth Dakin  <bdakin@apple.com>
+
+        REGRESSION (r132545): Some PDFs generated by WebKit are blank when viewed in 
+        Adobe Reader
+        https://bugs.webkit.org/show_bug.cgi?id=120240
+        -and corresponding-
+        <rdar://problem/14634453>
+
+        Reviewed by Anders Carlsson.
+
+        Hook up new WebSystemInterface API to find out if the current context is the PDF 
+        context. 
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2013-08-23  Alexey Proskuryakov  <ap@apple.com>
 
         [WK2] Assertion failures when loading XSL stylesheets with NetworkProcess
index 76c6b6bdd8475227ce5efd6dbd021e9f7cb17e4b..95589761e77363b84480a701668a39dcf4179c76 100644 (file)
@@ -72,6 +72,7 @@ void InitWebCoreSystemInterface(void)
         INIT(SignedPublicKeyAndChallengeString);
         INIT(GetPreferredExtensionForMIMEType);
         INIT(GetUserToBaseCTM);
+        INIT(CGContextIsPDFContext);
         INIT(GetWheelEventDeltas);
         INIT(GetNSEventKeyChar);
         INIT(HitTestMediaUIPart);
index 2409deeb7d5ac27862e9321062433af8a1591c09..9af8a1ecf853184ac631dfcbaebfcf0ca47becb2 100644 (file)
@@ -1,3 +1,17 @@
+2013-08-23  Beth Dakin  <bdakin@apple.com>
+
+        REGRESSION (r132545): Some PDFs generated by WebKit are blank when viewed in 
+        Adobe Reader
+        https://bugs.webkit.org/show_bug.cgi?id=120240
+        -and corresponding-
+        <rdar://problem/14634453>
+
+        Reviewed by Anders Carlsson.
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLion.a:
+        * libWebKitSystemInterfaceMountainLion.a:
+
 2013-08-23  Alex Christensen  <achristensen@apple.com>
 
         Re-separating Win32 and Win64 builds.
index 784468912cfca8480bed1005accabf10617ae21f..b1ce06016f4b7d4ce6e3c406c6d17e997fa01bc6 100644 (file)
@@ -209,6 +209,7 @@ OSStatus WKThemeDrawTrack(const HIThemeTrackDrawInfo* inDrawInfo, CGContextRef i
 
 
 BOOL WKCGContextIsBitmapContext(CGContextRef context);
+bool WKCGContextIsPDFContext(CGContextRef context);
 
 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
 
index 21834e891f457d04d3564361d9329ff4293960fd..682632fb2fdd4926db28709dea23ec449b60fb37 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index cce86ae719114d29c6a76bad621e8c5401d94241..45f3af22717692dfc62b921bbe1ed5b7f60c6c65 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a and b/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a differ