Bug 34545

Summary: [WinCairo] Properly Handle Margin Settings
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebKit Misc.Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
Patch to correct handling of margins when printing.
none
Revised patch, remove two extra spaces in function calls. aroben: review+

Description Brent Fulgham 2010-02-03 16:13:56 PST
The existing printing implementation for the WinCairo port does not properly consider the margin settings when calculating the scaling factor to use when drawing to the print context.  Consequently, a page printed using the WinCairo port is not the same size as that produced by Safari, and does not properly draw within the specified margins.

Fix is to compute the scaling factor after incorporating the margin regions.  This allows the WinCairo print output to closely match the Safari output.
Comment 1 Brent Fulgham 2010-02-03 16:25:33 PST
Created attachment 48077 [details]
Patch to correct handling of margins when printing.
Comment 2 WebKit Review Bot 2010-02-03 16:28:11 PST
Attachment 48077 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebKit/win/WebFrame.cpp:2081:  Extra space before ( in function call  [whitespace/parens] [4]
WebKit/win/WebFrame.cpp:2082:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Brent Fulgham 2010-02-03 16:30:42 PST
Created attachment 48078 [details]
Revised patch, remove two extra spaces in function calls.
Comment 4 Adam Roben (:aroben) 2010-02-04 09:07:07 PST
Comment on attachment 48078 [details]
Revised patch, remove two extra spaces in function calls.

> +    cairoMarginRect.scale(1.0f / scale);

You can just say "1 / scale" here. The 1 will get promoted to a float automatically.

r=me
Comment 5 Brent Fulgham 2010-02-04 11:31:12 PST
Landed in http://trac.webkit.org/changeset/54356.