REGRESSION (r95249): Right side can be truncated when printing
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Dec 2011 00:25:17 +0000 (00:25 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Dec 2011 00:25:17 +0000 (00:25 +0000)
commitbeed3f1436c43d0e37c17c64d312446a5ae18fcb
tree79d344d457bffbfc9b7195afb06dce9c4646f03f
parent055de385502c0bb13484384e0e1c7a86b1d472ee
REGRESSION (r95249): Right side can be truncated when printing
https://bugs.webkit.org/show_bug.cgi?id=73868

Reviewed by Darin Adler.

Source/WebCore:

When we print a page with an overflowed width, the right side of the page
can be truncated. This is due to a wrong rendering calculation.
Since 'maximumShrinkFactor' is a ratio based on 'pageSize',
'maximumShrinkFactor' should multiply (not 'originalPageSize') but 'pageSize'.
This bug happens if all the following conditions are met:
    - pageLogicalWidth < docLogicalWidth
    - originalPageSize.width * maximumShrinkFactor < docLogicalWidth
    - docLogicalWidth < pageLogicalWidth * maximumShrinkFactor

Test: printing/width-overflow.html

* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):

LayoutTests:

width-overflow.html checks if the page is printed without its right side
being truncated.

* printing/width-overflow.html: Added.
* platform/chromium-linux/printing/width-overflow-expected.png: Added.
* platform/chromium-linux/printing/width-overflow-expected.txt: Added.
* platform/mac-snowleopard/printing/width-overflow-expected.png: Added.
* platform/mac-snowleopard/printing/width-overflow-expected.txt: Added.
* platform/efl/Skipped: Skips width-overflow.html, since layoutTestController.setPrinting() is not implemented.
* platform/gtk/Skipped: Ditto.
* platform/qt/Skipped: Ditto.
* platform/win/Skipped: Ditto.
* platform/wincairo/Skipped: Ditto.
* platform/wk2/Skipped: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium-linux/printing/width-overflow-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium-linux/printing/width-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/efl/Skipped
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac-snowleopard/printing/width-overflow-expected.png [new file with mode: 0644]
LayoutTests/platform/mac-snowleopard/printing/width-overflow-expected.txt [new file with mode: 0644]
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
LayoutTests/platform/wincairo/Skipped
LayoutTests/platform/wk2/Skipped
LayoutTests/printing/width-overflow.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp