Vertical writing mode can overflow fixed size grandparent container
https://bugs.webkit.org/show_bug.cgi?id=93655

Reviewed by David Hyatt.

Source/WebCore:

Add a hook to RenderBox::availableHeight to exclude the containing block's
margin, border and padding. This is for auto-sizing perpendicular writing modes
to restrict to the minimum of the fill-available height and the viewport height.

This will be used in a future patch to implement "height: fill-available".

This behavior was recently specced in http://dev.w3.org/csswg/css3-sizing/#extrinsic-sizing.

Test: fast/writing-mode/auto-sizing-orthogonal-flows.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
(WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeight):
(WebCore::RenderBox::availableLogicalHeightUsing):
* rendering/RenderBox.h:
(RenderBox):
(WebCore::RenderBox::availableWidth):
(WebCore::RenderBox::availableHeight):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::computeIntrinsicRatioInformation):
* rendering/RenderView.cpp:
(WebCore::RenderView::availableLogicalHeight):
* rendering/RenderView.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeReplacedLogicalHeight):

LayoutTests:

* fast/writing-mode/auto-sizing-orthogonal-flows-expected.txt: Added.
* fast/writing-mode/auto-sizing-orthogonal-flows.html: Added.
* fast/writing-mode/percentage-height-orthogonal-writing-modes-expected.txt:
* fast/writing-mode/percentage-height-orthogonal-writing-modes-quirks-expected.txt:
* fast/writing-mode/percentage-height-orthogonal-writing-modes-quirks.html:
* fast/writing-mode/percentage-height-orthogonal-writing-modes.html:
* fast/writing-mode/table-percent-width-quirk-expected.png:
* fast/writing-mode/table-percent-width-quirk-expected.txt:
This test now correctly uses the containing blocks's availableHeight instead of the
initial containing block's height to size the perpendicular child.
* platform/chromium-linux/fast/ruby/base-shorter-than-text-expected.txt:
* platform/chromium-linux/fast/table/038-vertical-expected.png:
* platform/chromium-linux/fast/table/border-collapsing/004-vertical-expected.png:
The extra wrapping in this test is just because we subtract the body's margin when
computing the available height. If you force the table's container 16px smaller,
you get the same rendering at tip of tree WebKit.
* platform/chromium-win/fast/table/038-vertical-expected.txt:
* platform/chromium-win/fast/table/border-collapsing/004-vertical-expected.txt:
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
Add tests that will need rebaseline once this patch lands.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed