Vertical writing mode can overflow fixed size grandparent container
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2013 20:45:36 +0000 (20:45 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Jan 2013 20:45:36 +0000 (20:45 +0000)
commit337a4ff18806953ce1e9fc538a85743b26f1a4da
treeb71e686680d32f13e9ef5a275c6d37896253f2dc
parent040e296b5e11f30f08b1c17a528005d41b24eb8a
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: https://svn.webkit.org/repository/webkit/trunk@138838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/writing-mode/auto-sizing-orthogonal-flows-expected.txt [new file with mode: 0644]
LayoutTests/fast/writing-mode/auto-sizing-orthogonal-flows.html [new file with mode: 0644]
LayoutTests/fast/writing-mode/percentage-height-orthogonal-writing-modes-expected.txt
LayoutTests/fast/writing-mode/percentage-height-orthogonal-writing-modes-quirks-expected.txt
LayoutTests/fast/writing-mode/percentage-height-orthogonal-writing-modes-quirks.html
LayoutTests/fast/writing-mode/percentage-height-orthogonal-writing-modes.html
LayoutTests/fast/writing-mode/table-percent-width-quirk-expected.png
LayoutTests/fast/writing-mode/table-percent-width-quirk-expected.txt
LayoutTests/platform/chromium-linux/fast/ruby/base-shorter-than-text-expected.txt
LayoutTests/platform/chromium-linux/fast/table/038-vertical-expected.png
LayoutTests/platform/chromium-linux/fast/table/border-collapsing/004-vertical-expected.png
LayoutTests/platform/chromium-win/fast/table/038-vertical-expected.txt
LayoutTests/platform/chromium-win/fast/table/border-collapsing/004-vertical-expected.txt
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/svg/RenderSVGRoot.cpp