W3C home > Mailing lists > Public > public-css-testsuite@w3.org > June 2010

ex unit testcases; Microsoft's border-spacing-083.xht and border-spacing-084.xht

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Tue, 29 Jun 2010 20:34:56 -0700
Message-ID: <faaf667e109d2630bb6f768d2dbfa204.squirrel@cp3.shieldhost.com>
To: "public-css-testsuite@w3.org" <public-css-testsuite@w3.org>
Cc: "Arron Eicholz" <Arron.Eicholz@microsoft.com>
Hello all,

Whenever ex unit with Ahem are being used in a testcase, I suggest to
use a font-size of 20px and not a font-size of 16px (or 12pt). I suggest
to use a font-size which is a factor of 5: eg 20px, 25px, 30px, 35px,

Another idea would be to use value of ex so that when multiplied by 0.8,
would result in an integer: 6.25ex, 12.5ex, 18.75ex, 25ex, etc seem to

The reason is that this avoids fractional pixel when calculating a length.



Font-size for those 2 testcases have been defined as 12pt, which is
16px. When doing this math,

(left offset of the middle bar) 15ex =
15ex * 0.8em/ex * 16px/em

some browsers will first calculate 0.8 * 16 = 12.8px and then will round
up as 13px before multiplying by 15.

So, in both border-spacing-083.xht and border-spacing-084.xht testcases,
the expected calculation is

15ex * 0.8em/ex * 16px/em = 192px

but in some browsers it will be

15ex * roundUp(0.8em/ex * 16px/em) = 195px

This is the case for Firefox 3.6.6 and Konqueror 4.4.4.

If you examine carefully border-spacing-083.xht and
border-spacing-084.xht testcases with Firefox 3.6.6 or Konqueror 4.4.4
(with or without DOM inspector, DOM treeviewer), you will see that the
middle bar overlaps a bit the last bar.

My conclusion: all testcases involving ex unit with Ahem should be using
a font-size of 20px or make appropriate adjustments to avoid fractional
pixel issues.

regards, Gérard
Contributions to the CSS 2.1 test suite:

CSS 2.1 test suite (alpha 3; June 15th 2010):

CSS 2.1 test suite contributors:
Received on Wednesday, 30 June 2010 03:35:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 20 January 2023 19:58:14 UTC