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: http://svn.webkit.org/repository/webkit/trunk@102281 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed