[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:50:03 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit e7caaa2e0eadb1f8bfd6ebb19a176ead71e1bf8a
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 4 21:41:21 2003 +0000

            Reviewed by Richard.
    
            - fixed 3298153 -- get "screen font while printing" error, bad stuff happens after that (Sherlock, Safari)
    
            * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]):
            If we find ourselves in drawRect with the wrong printing mode, that usually
            means we're being printed as part of some larger print process, so do the
            layout in printing mode.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4764 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 4db1799..210ea35 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,14 @@
+2003-08-04  Darin Adler  <darin at apple.com>
+
+        Reviewed by Richard.
+
+        - fixed 3298153 -- get "screen font while printing" error, bad stuff happens after that (Sherlock, Safari)
+
+        * WebView.subproj/WebHTMLView.m: (-[WebHTMLView drawRect:]):
+        If we find ourselves in drawRect with the wrong printing mode, that usually
+        means we're being printed as part of some larger print process, so do the
+        layout in printing mode.
+
 2003-08-04  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: <rdar://problem/3360977>: REGRESSION (7B28-7B29): main webview rejects drop of doc icon from BBEdit
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index e7004f3..c5efa22 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -27,6 +27,10 @@
 #import <AppKit/NSResponder_Private.h>
 #import <CoreGraphics/CGContextGState.h>
 
+ at interface WebHTMLView (WebHTMLViewPrivate)
+- (void)_setPrinting:(BOOL)printing pageWidth:(float)pageWidth;
+ at end
+
 @interface NSArray (WebHTMLView)
 - (void)_web_makePluginViewsPerformSelector:(SEL)selector withObject:(id)object;
 @end
@@ -518,13 +522,19 @@
 {
     LOG(View, "%@ drawing", self);
     
-    WebTextRendererFactory *textRendererFactory = [WebTextRendererFactory sharedFactory];
-    
     BOOL subviewsWereSetAside = _private->subviewsSetAside;
     if (subviewsWereSetAside) {
         [self _restoreSubviews];
     }
     
+    // This helps when we print as part of a larger print process.
+    // If the WebHTMLView itself is what we're printing, then we will never have to do this.
+    BOOL wasInPrintingMode = _private->printing;
+    BOOL isPrinting = ![NSGraphicsContext currentContextDrawingToScreen];
+    if (wasInPrintingMode != isPrinting) {
+        [self _setPrinting:isPrinting pageWidth:0];
+    }
+    
     if ([[self _bridge] needsLayout]) {
         _private->needsLayout = YES;
     }
@@ -561,16 +571,19 @@
     [(WebClipView *)[self superview] setAdditionalClip:rect];
 
     NS_DURING {
-        NSView *focusView = [NSView focusView];
-        if ([WebTextRenderer shouldBufferTextDrawing] && focusView)
-            [textRendererFactory startCoalesceTextDrawing];
+        WebTextRendererFactory *textRendererFactoryIfCoalescing = nil;
+        if ([WebTextRenderer shouldBufferTextDrawing] && [NSView focusView]) {
+            textRendererFactoryIfCoalescing = [WebTextRendererFactory sharedFactory];
+            [textRendererFactoryIfCoalescing startCoalesceTextDrawing];
+        }
 
         //double start = CFAbsoluteTimeGetCurrent();
         [[self _bridge] drawRect:rect];
         //LOG(Timing, "draw time %e", CFAbsoluteTimeGetCurrent() - start);
 
-        if ([WebTextRenderer shouldBufferTextDrawing] && focusView)
-            [textRendererFactory endCoalesceTextDrawing];
+        if (textRendererFactoryIfCoalescing != nil) {
+            [textRendererFactoryIfCoalescing endCoalesceTextDrawing];
+        }
 
         [(WebClipView *)[self superview] resetAdditionalClip];
 
@@ -607,6 +620,10 @@
     LOG(Timing, "%s draw seconds = %f", widget->part()->baseURL().URL().latin1(), thisTime);
 #endif
 
+    if (wasInPrintingMode != isPrinting) {
+        [self _setPrinting:wasInPrintingMode pageWidth:0];
+    }
+
     if (subviewsWereSetAside) {
         [self _setAsideSubviews];
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list