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

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,
etc

[Addendum
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
work.
]

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

http://test.csswg.org/source/contributors/microsoft/submitted/Chapter_17/border-spacing-083.xht

http://test.csswg.org/source/contributors/microsoft/submitted/Chapter_17/border-spacing-084.xht

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:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

CSS 2.1 test suite (alpha 3; June 15th 2010):
http://test.csswg.org/suites/css2.1/20100615/html4/toc.html

CSS 2.1 test suite contributors:
http://test.csswg.org/source/contributors/

Received on Wednesday, 30 June 2010 03:35:32 UTC