CSS 2.1 failure: vertical-align-boxes-001 fails
authorrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Jul 2012 08:57:27 +0000 (08:57 +0000)
committerrobert@webkit.org <robert@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Jul 2012 08:57:27 +0000 (08:57 +0000)
commite1b206abd092ae43a5610e2c93f96681fe3db4bc
tree462f091e13ac13e94e06e6d41156ca5c76b41f1c
parent1b47db414e6f33928a4b978201a8c70705559da0
CSS 2.1 failure: vertical-align-boxes-001 fails
https://bugs.webkit.org/show_bug.cgi?id=90626

Reviewed by Eric Seidel.

Source/WebCore:

Tests: css2.1/20110323/vertical-align-boxes-001.htm

A percentage value vertical-align is always a percentage of the actual line-height rather than
the margin box per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align: 'Percentages:
refer to the 'line-height' of the element itself'.  Confusingly, RenderBox::lineheight() is a
shorthand into the dimensions of the margin box for replaced elements in the other vertical-align
cases, i.e. where it's the margin box that's relevant rather than the 'line-height'. So rather than patch RenderBox's
lineHeight() to somehow consider the percentage cases, just give percentage vertical-align the full computedLineHeight()
rather than lineHeight()'s margin box.

* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::verticalPositionForBox):

LayoutTests:

* css2.1/20110323/vertical-align-boxes-001-expected.html: Added.
* css2.1/20110323/vertical-align-boxes-001.htm: Added.
  This patch fixes the 'percentage' case in this test so that it calculates 50% of the
  line-height of 60px rather than 50% of the img's margin-box of -8px.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css2.1/20110323/vertical-align-boxes-001-expected.html [new file with mode: 0644]
LayoutTests/css2.1/20110323/vertical-align-boxes-001.htm [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RootInlineBox.cpp