Bug 52495 - Beef up PrintContext for WebKit2
Summary: Beef up PrintContext for WebKit2
Alias: None
Product: WebKit
Classification: Unclassified
Component: Printing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexey Proskuryakov
Depends on:
Reported: 2011-01-14 16:36 PST by Alexey Proskuryakov
Modified: 2011-01-17 10:31 PST (History)
2 users (show)

See Also:

proposed patch (11.80 KB, patch)
2011-01-14 17:15 PST, Alexey Proskuryakov
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2011-01-14 16:36:36 PST
Patch forthcoming.
Comment 1 Alexey Proskuryakov 2011-01-14 17:15:02 PST
Created attachment 79037 [details]
proposed patch
Comment 2 Early Warning System Bot 2011-01-14 17:44:13 PST
Attachment 79037 [details] did not build on qt:
Build output: http://queues.webkit.org/results/7533066
Comment 3 mitz 2011-01-14 17:45:34 PST
Comment on attachment 79037 [details]
proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=79037&action=review

> Source/WebCore/ChangeLog:19
> +        Round pahe height to an integer, because Mac code does that, and because page height is

Typo: pahe

> Source/WebCore/page/PrintContext.cpp:35
> +// print in IE and Camino. This lets them use fewer sheets than they

Camino, really?

> Source/WebCore/page/PrintContext.cpp:38
> +const float PrintingMinimumShrinkFactor = 1.25f;

Can you drop the f? Our current style is to use a lowercase p here. Not sure there’s a reason to say “printing” in this context.

> Source/WebCore/page/PrintContext.cpp:44
> +const float PrintingMaximumShrinkFactor = 2.0f;

Can you drop the .0f and use a lowercase P?

> Source/WebCore/page/PrintContext.cpp:68
> +void PrintContext::computePageRects(const FloatRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, float& outPageHeight, bool allowHorizontalMultiPages)

I have no idea what a multi-page is. Perhaps allowHorizontalTiling or allowTilingHorizontally?

> Source/WebCore/page/PrintContext.cpp:141
> +        return 1.0f;

Is the .0f necessary?

> Source/WebCore/page/PrintContext.cpp:145
> +        return 1.0f;


> Source/WebCore/page/PrintContext.cpp:147
> +    float maxShrinkToFitScaleFactor = 1.0f / PrintingMaximumShrinkFactor;

This .0f is not needed.
Comment 4 Alexey Proskuryakov 2011-01-17 10:31:52 PST
Committed <http://trac.webkit.org/changeset/75955>.