percentage top value of position:relative element not calculated using parent's min...
authorrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Feb 2013 13:06:03 +0000 (13:06 +0000)
committerrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 16 Feb 2013 13:06:03 +0000 (13:06 +0000)
commitab8cd862b849f8fba834c74c94f5990ee9a2795d
tree09a254745a546680d6d74d32a250a9ec35b3941f
parent1e9febdb58927b94199ecde17094bc90ba61aa56
percentage top value of position:relative element not calculated using parent's min-height unless height set
https://bugs.webkit.org/show_bug.cgi?id=14762

Reviewed by Julien Chaffraix.

Source/WebCore:

Percentage height "is calculated with respect to the height of the generated box's containing block" says
http://www.w3.org/TR/CSS21/visudet.html#the-height-property and "If the height of the containing block is not
specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the
value computes to 'auto'." So when calculating the used height of a replaced element do not crawl through ancestor
blocks except when traversing anonymous blocks. Ensure that anonymous table cells are not skipped through though.

http://www.w3.org/TR/CSS21/tables.html#height-layout adds "In CSS 2.1, the height of a cell box is the minimum
height required by the content." This height is decided by allowing table cells to report their height as auto.
It's not clear why http://trac.webkit.org/changeset/91242 decided it should no longer do this - doing so caused
us to regress in our rendering of computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor.html.

Tests: fast/block/percent-top-parent-respects-min-height.html
       fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr.html
       fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor.html
       fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-vertical-lr.html
       fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
(WebCore):
(WebCore::RenderBoxModelObject::relativePositionOffset):
* rendering/RenderBoxModelObject.h:
(RenderBoxModelObject):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::hasReplacedLogicalHeight):

LayoutTests:

* fast/block/percent-top-parent-respects-min-height-expected.txt: Added.
* fast/block/percent-top-parent-respects-min-height.html: Added.
* fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-expected.txt: Added.
* fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr-expected.txt: Added.
* fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr.html: Added.
* fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor.html: Added.
* fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-expected.txt: Added.
* fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-vertical-lr-expected.txt: Added.
* fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-vertical-lr.html: Added.
* fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/block/percent-top-parent-respects-min-height-expected.txt [new file with mode: 0644]
LayoutTests/fast/block/percent-top-parent-respects-min-height.html [new file with mode: 0644]
LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-expected.txt [new file with mode: 0644]
LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr-expected.txt [new file with mode: 0644]
LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr.html [new file with mode: 0644]
LayoutTests/fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor.html [new file with mode: 0644]
LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-expected.txt [new file with mode: 0644]
LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-vertical-lr-expected.txt [new file with mode: 0644]
LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor-vertical-lr.html [new file with mode: 0644]
LayoutTests/fast/replaced/computed-image-width-with-percent-height-inside-table-cell-and-fixed-ancestor.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderReplaced.cpp