Fractional pixel problem with height-083 , height-084 , width-083 , width-084 (and in min- and max- as well)

Hello,

height-083.htm
==============

http://test.csswg.org/suites/css2.1/20100815/html4/height-083.htm

div
  {
  font: 12pt ahem;
  position: relative;
  }

#div2
  {
  background: black;
  height: 7.5ex;
  width: 1in;
  }

The code assumes, expects the following calculation:

16 * 7.5 * 0.8 = 96px;

but in fact Firefox 3.6.x calculates

(16 mult 0.8) == 12.8 which is then rounded up to 13px and
then 13 mult 7.5 = 97.5 (such 97.5 value is reported as computed value
in Firefox's DOM inspector) which is then rounded up to 98px.

A 2px difference!

------------

min-height-083.htm
==================

http://test.csswg.org/suites/css2.1/20100815/html4/min-height-083.htm

There are other variations of the same problem in other testcases: the
reference box is also expressed with 7.5ex unit but not for height or
width rather/instead for a border: border-top-width, border-left-width
should be 96px but its computed value is 97px because 97.5px is rounded
down, giving this time a 1px difference. See min-height-083.htm on this
one but also

http://test.csswg.org/suites/css2.1/20100815/html4/width-083.htm
http://test.csswg.org/suites/css2.1/20100815/html4/min-width-083.htm
http://test.csswg.org/suites/css2.1/20100815/html4/max-width-083.htm

------------

12 Proposed replacements
========================


http://test.csswg.org/suites/css2.1/20100815/html4/height-083.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/height-083.htm


http://test.csswg.org/suites/css2.1/20100815/html4/min-height-083.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/min-height-083.htm


http://test.csswg.org/suites/css2.1/20100815/html4/max-height-083.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/max-height-083.htm
{height: 8.5ex; in the testcase, I changed that to height: 10ex; for 2
reasons: a) more noticeable height difference in case of test failure of
max-height, especially/in particular if the user agent uses 1ex ==
0.5em) and also in case the font-size is reduced b) avoid fractional
pixel problem in case the user agent, even in those values. In that
testcase, height: 10ex is safer and more robust.}


http://test.csswg.org/suites/css2.1/20100815/html4/height-084.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/height-084.htm


http://test.csswg.org/suites/css2.1/20100815/html4/min-height-084.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/min-height-084.htm


http://test.csswg.org/suites/css2.1/20100815/html4/max-height-084.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/max-height-084.htm
{height: 8.5ex; in the testcase, I changed that to height: 10ex; for 2
reasons: a) bigger gap in case of test failure of max-height,
especially/in particular if the user agent uses 1ex == 0.5em) and also
in case the font-size is reduced b) avoid fractional pixel problem in
case the user agent, even in those values. In that testcase, height:
10ex is safer and more robust.}


http://test.csswg.org/suites/css2.1/20100815/html4/width-083.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/width-083.htm


http://test.csswg.org/suites/css2.1/20100815/html4/min-width-083.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/min-width-083.htm


http://test.csswg.org/suites/css2.1/20100815/html4/max-width-083.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/max-width-083.htm
{width: 8.5ex; in the testcase, I changed that to width: 10ex; for 2
reasons: a) more noticeable width difference in case of test failure of
max-width, especially/in particular if the user agent uses 1ex == 0.5em)
and also in case the font-size is reduced b) avoid fractional pixel
problem in case the user agent, even in those values. In that testcase,
width: 10ex is safer and more robust.}


http://test.csswg.org/suites/css2.1/20100815/html4/width-084.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/width-084.htm


http://test.csswg.org/suites/css2.1/20100815/html4/min-width-084.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/min-width-084.htm


http://test.csswg.org/suites/css2.1/20100815/html4/max-width-084.htm
Proposed replacement:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/max-width-084.htm
{width: 8.5ex; in the testcase, I changed that to width: 10ex; for 2
reasons: a) more noticeable width difference in case of test failure of
max-width, especially/in particular if the user agent uses 1ex == 0.5em)
and also in case the font-size is reduced b) avoid fractional pixel
problem in case the user agent, even in those values. In that testcase,
width: 10ex is safer and more robust.}



regards, Gérard
-- 
Contributions to the CSS 2.1 test suite:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

CSS 2.1 test suite (beta 3; August 15th 2010):
http://test.csswg.org/suites/css2.1/20100815/html4/toc.html

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

Received on Sunday, 12 September 2010 18:04:58 UTC