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

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:30:30 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 79bcee3c40d0011e2c6549d057d0f7690816202b
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Mar 23 22:56:12 2004 +0000

    	Fix for 3513627, HTML mail prints upside down occasionally.  Change printing so that it never resizes the
            WebHTMLView when formatting for printing.  When computing page rects, instead of using the view's bounds,
            use the root layer's width instead.
    
            Reviewed by darin
    
            * khtml/khtmlview.cpp:
            (KHTMLView::layout):
            * kwq/WebCoreBridge.h:
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6248 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c184ce0..89c69c3 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,19 @@
 2004-03-23  David Hyatt  <hyatt at apple.com>
 
+	Fix for 3513627, HTML mail prints upside down occasionally.  Change printing so that it never resizes the
+        WebHTMLView when formatting for printing.  When computing page rects, instead of using the view's bounds,
+        use the root layer's width instead.
+
+        Reviewed by darin
+
+        * khtml/khtmlview.cpp:
+        (KHTMLView::layout):
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
+
+2004-03-23  David Hyatt  <hyatt at apple.com>
+
 	Fix for crasher 3598204, previousKeyView was calling nextKeyView instead.
 	
         Reviewed by darin
@@ -15,9 +29,6 @@
 
         - fixed deployment build
 
-        * kwq/KWQLineEdit.mm: (QLineEdit::QLineEdit): Move view initializer inside
-        block with exceptions blocked.
-
 2004-03-22  David Hyatt  <hyatt at apple.com>
 
 	Wire up NSSearchField to WebCore.  Add support for placeholder strings, autosaving of recent items, the ability to show/hide
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index f470029..99e6b0f 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -627,7 +627,8 @@ void KHTMLView::layout()
     d->layoutSchedulingEnabled=true;
     d->layoutSuppressed = false;
 
-    resizeContents(layer->width(), layer->height());
+    if (!root->printingMode())
+        resizeContents(layer->width(), layer->height());
 
     // Now update the positions of all layers.
     layer->updateLayerPositions(d->doFullRepaint);
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 3794f70..c53630a 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -174,7 +174,7 @@ typedef enum {
 - (void)setNeedsLayout;
 - (void)drawRect:(NSRect)rect;
 - (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
-- (NSArray*)computePageRectsWithPrintWidth:(float)printWidth printHeight:(float)printHeight;
+- (NSArray*)computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight;
 
 - (void)setUsesInactiveTextBackgroundColor:(BOOL)uses;
 - (BOOL)usesInactiveTextBackgroundColor;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index f070b34..bbcf1ca 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -605,22 +605,26 @@ static BOOL nowPrinting(WebCoreBridge *self)
 }
 
 // Used by pagination code called from AppKit when a standalone web page is printed.
-- (NSArray*)computePageRectsWithPrintWidth:(float)printWidth printHeight:(float)printHeight
+- (NSArray*)computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight
 {
     [self _setupRootForPrinting:YES];
     NSMutableArray* pages = [NSMutableArray arrayWithCapacity:5];
-	if (printWidth == 0 || printHeight == 0) {
-		return pages;
-	}
+    if (printWidthScaleFactor == 0 || printHeight == 0)
+        return pages;
 	
+    if (!_part || !_part->xmlDocImpl() || !_part->view()) return pages;
+    RenderCanvas* root = static_cast<khtml::RenderCanvas *>(_part->xmlDocImpl()->renderer());
+    if (!root) return pages;
+    
     KHTMLView* view = _part->view();
     NSView* documentView = view->getDocumentView();
     if (!documentView)
         return pages;
 	
     float currPageHeight = printHeight;
-    float docHeight = NSHeight([documentView bounds]);
-    float docWidth = NSWidth([documentView bounds]);
+    float docHeight = root->layer()->height();
+    float docWidth = root->layer()->width();
+    float printWidth = docWidth/printWidthScaleFactor;
     
     // We need to give the part the opportunity to adjust the page height at each step.
     for (float i = 0; i < docHeight; i += currPageHeight) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list