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

sullivan sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:14:08 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c16f965daf8ddfc4397ebfcb9f431090101346d1
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 20 03:57:18 2003 +0000

    WebKit:
    
            - WebKit part of fix for:
            <rdar://problem/3305671>: Web pages print with 1.25" border without regard to Page
            Setup margin settings
    
            Reviewed by Dave.
    
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView beginDocument]):
            Lay out the page into a width 25% wider than there's room for on the printed page.
            This will make pages that can fit into a thin area be scaled down a little when printed,
            which lets them fit on fewer pages. This closely matches what IE and Camino (at least)
            do; I used Google as my test page, and the Google logo is now precisely the same size
            when printed from Safari as when printed from IE. Pages that don't fit into a thin
            area are already causing the printed page to be scaled horizontally to fit, and this
            won't affect them.
    
    WebBrowser:
    
            - WebBrowser part of fix for:
            <rdar://problem/3305671>: Web pages print with 1.25" border without regard to Page
            Setup margin settings
    
            Reviewed by Dave.
    
            * BrowserDocument.m:
            (-[BrowserDocument printInfo]):
            Use the entire imageable area of the page (except max out at the paper size).
            This matches what IE does; you can tell by formatting for different printers
            in Page Setup and checking the printed margins against the margins reported
            in the Settings:Summary part of Page Setup.
    
            With this change and the accompanying WebKit change to initially lay out into
            an area 25% wider than fits on the page, and Hyatt's earlier change to re-layout
            to the width of the widest element on the page, our printed pages are much, much
            closer to how other browsers print. We are now no more different from other
            browsers than they are from each other, at least for non-edge case pages.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5595 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 53d3b9d..990d1a5 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2003-11-19  John Sullivan  <sullivan at apple.com>
+
+        - WebKit part of fix for:
+        <rdar://problem/3305671>: Web pages print with 1.25" border without regard to Page 
+        Setup margin settings
+
+        Reviewed by Dave.
+
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView beginDocument]):
+        Lay out the page into a width 25% wider than there's room for on the printed page.
+        This will make pages that can fit into a thin area be scaled down a little when printed,
+        which lets them fit on fewer pages. This closely matches what IE and Camino (at least)
+        do; I used Google as my test page, and the Google logo is now precisely the same size
+        when printed from Safari as when printed from IE. Pages that don't fit into a thin
+        area are already causing the printed page to be scaled horizontally to fit, and this
+        won't affect them.
+
 2003-11-19  Chris Blumenberg  <cblu at apple.com>
 
 	Fixed: <rdar://problem/3489935>: Mentioning "to Disk" in context menus such as "Download Linked File To Disk..." is redundant
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 97022c8..762df4d 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -49,6 +49,14 @@
 #define TextDragHysteresis  		3.0
 #define TextDragDelay			0.15
 
+// By imaging to a width a little wider than the available pixels,
+// thin pages will be scaled down a little, matching the way they
+// print in IE and Camino. This lets them use fewer sheets than they
+// would otherwise, which is presumably why other browsers do this.
+// Wide pages will be scaled down as necessary to fit their content, 
+// so this factor only affects thin pages.
+#define PrintingExtraWidthFactor        1.25
+
 #define AUTOSCROLL_INTERVAL             0.1
 
 #define DRAG_LABEL_BORDER_X		4.0
@@ -1675,7 +1683,7 @@ static WebHTMLView *lastHitView = nil;
     float pageWidth = 0.0;
     if (![[self _bridge] isFrameSet]) {
         NSPrintInfo *printInfo = [[NSPrintOperation currentOperation] printInfo];
-        pageWidth = [printInfo paperSize].width - [printInfo leftMargin] - [printInfo rightMargin];
+        pageWidth = ([printInfo paperSize].width - [printInfo leftMargin] - [printInfo rightMargin])*PrintingExtraWidthFactor;
     }
     [self _setPrinting:YES pageWidth:pageWidth adjustViewSize:YES];	// will relayout
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list