Re: vertical-align-115/116 invalid

On 10/17/2010 12:46 PM, L. David Baron wrote:
> These tests:
> http://test.csswg.org/suites/css2.1/20101001/html4/vertical-align-115.htm
> http://test.csswg.org/suites/css2.1/20101001/html4/vertical-align-116.htm
> http://test.csswg.org/suites/css2.1/20101001/xhtml1/vertical-align-115.xht
> http://test.csswg.org/suites/css2.1/20101001/xhtml1/vertical-align-116.xht
> are testing for particular alignment of subscripts and superscripts
> whose origin I don't understand; it's not the values in the font
> metrics.
>
> Gecko implements subscript and superscript alignment using the
> metrics of the font, which I think should at least be the preferred
> way, although it's not required by the spec.
>
> The Ahem font has a subscript Y offset in its OS2 table of 143 (on a
> 1000 grid) and a superscript Y offset of 453.  This means that for
> 48px Ahem, the subscript should have its baseline lowered 6.86px and
> a superscript should have its baseline raised 21.74px.  Since the
> baseline of Ahem is 1/5 from the bottom (i.e., 9.6px in 48px, 19.2px
> in 96px, and 28.8px in 144px), in the superscript testcase the
> subscript glyph should have its bottom 16.46px below the line's
> baseline (9.6px + 6.86px); in the superscript testcase the
> superscript glyph should have its bottom 12.14px above the normal
> baseline (21.74 - 9.6).  In contrast, the 96px glyph (in test 115)
> should extend 19.2px below the baseline and the 144px glyph (in test
> 116) should extend 28.8px below the baseline.
>
> This would mean that the values of 'top' to be used in the tests, if
> a browser used the font's metrics, and ignoring all the potential
> rounding issues from these horribly unround numbers, would be
> 45.26px (48px - (19.2px - 16.46px)) for test 115 and 55.06px (96px -
> (28.8px + 12.14px) for test 116.
>
> In fact, Mozilla on Linux passes the tests if I adjust the 44px to
> 45px and the 0.6in (57.6px) to 55px.
>
> That said, I think these tests should be removed, since the spec has
> no requirement for using the font's metrics for subscript and
> superscript offsets.

Seems to me that ideally, we'd update Ahem to have rounder numbers
for these offsets, adjust the test to match, and mark it as a "may".
But I'm fine with taking them out of the build for now.

~fantasai

Received on Saturday, 23 October 2010 10:49:14 UTC