W3C home > Mailing lists > Public > public-css-testsuite@w3.org > April 2012

Tests which are dependent on local fonts and how 'line-height: normal' is computed

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Wed, 18 Apr 2012 20:31:11 -0400
Message-ID: <c24badd9cf7fba32de9645632128d9b5.squirrel@ed-sh-cp3.entirelydigital.com>
To: "Arron Eicholz" <Arron.Eicholz@microsoft.com>
Cc: "Public CSS test suite mailing list" <public-css-testsuite@w3.org>

There are more and more tests which I am having difficulties doing
reftests because

1- they are dependent on how tall the line-height of the pass/fail
conditions sentence <p> is: this varies from one font to another.



The amount of blue that we can see depends on the local font used. If I
use "DejaVu Serif", then line-height of <p> will be 19px. Therefore the
amount of blue will be:
    16px : body's margin-top collapsing with p's margin-top
    19px : line-height of p
    16px : margin-bottom of p

which will be substracted from the blue's height (96px) == 45px

but if I use "FreeSerif" font, then p's line-height: normal is going to
be computed as 20px ... which will affect the calculation of the height
of the blue rectangle that is going to be rendered.

Depending on the font used, the height of the blue rectangle can vary
from 43px (rare and unlikely but possible), 44px (eg FreeSerif), 45px
(DejaVu Serif).

2- Another issue is that the number of line boxes of the pass/fail
conditions <p> can become 2 if viewport width is set to minimum 640px;
again, this would make an ordinary reftest wrong.


The solution I see + propose is to break the pass/fail condition into 2
line boxes when the pass/fail conditions sentence is long and then set

p {line-height: 1.25em;}

The only way to create a reliable reftest is to control the height of
line boxes.

Contributions to the CSS 2.1 test suite:

CSS 2.1 Test suite RC6, March 23rd 2011:

CSS 2.1 test suite harness:

Contributing to to CSS 2.1 test suite:
Received on Thursday, 19 April 2012 00:31:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:13:24 UTC