• ojan@chromium.org's avatar
    REGRESSION(r128517): Percentage heights in quirks mode collapse when printing · b2c9c3d0
    ojan@chromium.org authored
    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: http://svn.webkit.org/repository/webkit/trunk@141459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b2c9c3d0
quirks-percentage-height-body.html 156 Bytes