REGRESSION(r128517): Percentage heights in quirks mode collapse when printing
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2013 20:00:12 +0000 (20:00 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2013 20:00:12 +0000 (20:00 +0000)
commitebdf4944da24a1ad1b6f9c09fff8ef4401b0b96b
tree6b4a1e845b0f2d42c494d9995df7b6cc9b0b5381
parentcae63764e2de62fec8786e9146cdbe788403ff53
REGRESSION(r128517): Percentage heights in quirks mode collapse when printing
https://bugs.webkit.org/show_bug.cgi?id=108382

Reviewed by David Hyatt.

Source/WebCore:

r128517 clean up our containing block finding logic, but broke percentage
heights in quirks mode during printing since the RenderView would have 0 height.
Turns out we already had a long-standing bug where we'd incorrectly
treat collapse percentage heights on the body when printing as well.

Fix both bugs by changing the way we grab the logical height on the RenderView.
RenderView::computeLogicalHeight returns 0 when printing. For the purposes of
stretching and percentage heights, we instead need to return the pageLogicalHeight.

Tests: printing/quirks-percentage-height-body.html
       printing/quirks-percentage-height.html
       printing/standards-percentage-heights.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeight):
This FIXME is outdated and already fixed. Also, call viewLogicalHeightForPercentages
which does the same logic except also correctly handles column RenderViews.
(WebCore::RenderBox::viewLogicalHeightForPercentages):
(WebCore::RenderBox::computePercentageLogicalHeight):
* rendering/RenderBox.h:

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::viewLogicalHeightForPercentages):
(WebCore):
(WebCore::RenderBox::computePercentageLogicalHeight):
* rendering/RenderBox.h:
(RenderBox):

LayoutTests:

* platform/chromium/fast/multicol/shrink-to-column-height-for-pagination-expected.txt:
We're just clipping more content that you can't scroll to anyways. This looks
like an improvement to me.
* printing/css2.1/page-break-inside-000-expected.txt:
We pass this test now!
* printing/quirks-percentage-height-body-expected.html: Added.
* printing/quirks-percentage-height-body.html: Added.
* printing/quirks-percentage-height-expected.html: Added.
* printing/quirks-percentage-height.html: Added.
* printing/standards-percentage-heights-expected.html: Added.
* printing/standards-percentage-heights.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium/fast/multicol/shrink-to-column-height-for-pagination-expected.txt
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/printing/css2.1/page-break-inside-000-expected.txt
LayoutTests/printing/quirks-percentage-height-body-expected.html [new file with mode: 0644]
LayoutTests/printing/quirks-percentage-height-body.html [new file with mode: 0644]
LayoutTests/printing/quirks-percentage-height-expected.html [new file with mode: 0644]
LayoutTests/printing/quirks-percentage-height.html [new file with mode: 0644]
LayoutTests/printing/standards-percentage-heights-expected.html [new file with mode: 0644]
LayoutTests/printing/standards-percentage-heights.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h