Bug 34545 - [WinCairo] Properly Handle Margin Settings
Summary: [WinCairo] Properly Handle Margin Settings
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-03 16:13 PST by Brent Fulgham
Modified: 2010-02-04 13:35 PST (History)
1 user (show)

See Also:


Attachments
Patch to correct handling of margins when printing. (4.85 KB, patch)
2010-02-03 16:25 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Revised patch, remove two extra spaces in function calls. (4.84 KB, patch)
2010-02-03 16:30 PST, Brent Fulgham
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.