Re: t1008-c44-ln-box-02-d-ag.htm, t100801-c544-valgn-01-d-ag.htm

On 02/27/2009 05:43 PM, Arron Eicholz wrote:
> http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t1008-c44-ln-box-02-d-ag.htm

I've worked through this example, and the problem is that the spec is vague
about whether the box used to align replaced elements is the content box or
the border box. The test works out (afaict) if you're aligning the content-box
height. What the browsers seem to be doing is using the border box height for
alignment. So this needs to be filed as a CSS2.1 issue.

> http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t100801-c544-valgn-01-d-ag.htm
>
> We believe there is a bug in the test cases. The background image of this test
> case is off by 1 pixel. The main issue seems to relate to the computation of
> 'vertical-align: middle;' the latter is defined in CSS2.1 [1] as: "Align the
> vertical midpoint of the box with the baseline of the parent box plus half the
> x-height of the parent."
>
> In this test case, the font size is 15px so 1em == 15px. The Ahem font specifies
> x-height to be 0.8em i.e. 12px. Therefore the 2em/30px mask image is positioned
> thus:
>
> "Align the vertical midpoint of the box with the baseline of the parent box..."
> 	The image is 15px above the baseline and 15px below.
>
> "... plus half the x-height of the parent."
> 	This moves the image up another 6px. The image is now 21px above the
>       baseline and 9px below.
>
> The 15px X characters have 12px ascent and 3px descent, which requires 9px of
> white fill above them and 6px below them. The background image, however, assumes
> 10px on top and 5px below, resulting in the red outlines observable in all major
> browsers.
>
> All major browsers currently fail this test as a result of this off-by-one delta.
>
> The test case background image needs to be updated to make this case valid.
>
> [1] http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align

Updated. Please let me know if this fix is ok:
   http://test.csswg.org/source/approved/css2.1/archive/raw-tests/css1tests/css1test544b.xml

~fantasai

Received on Monday, 25 January 2010 10:28:08 UTC