[RC6] At least 12 background-position-* tests have fractional pixel issues

Arron,

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-019.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-019.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-020.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-020.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-031.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-031.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-032.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-032.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-043.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-043.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-044.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-044.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-055.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-055.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-056.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-056.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-067.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-067.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-068.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-068.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-103.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-103.htm

[RC6]
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-104.htm

[nightly-unstable]
http://test.csswg.org/suites/css2.1/nightly-unstable/html4/background-position-104.htm

and possibly a few others.



There are 2 problems with e.g.
http://test.csswg.org/suites/css2.1/20110323/html4/background-position-067.htm

1st problem
-----------

line 18 width: 1.16in;

96px mult by 1.16  ==  111.36px

Since the width should be 96px plus width of "support/black15x15.png",
then it was more precise to use 111px instead of 1.16in

2nd problem
-----------
This one is more coriaceous.

line 23 background-position: 1in;

"
If only one value is specified, the second value is assumed to be
'center'. If at least one value is not a keyword, then the first value
represents the horizontal position and the second represents the
vertical position.
(...)
center
    Equivalent to '50%' for the horizontal position if it is not
otherwise given, or '50%' for the vertical position if it is.
"

So,

background-position: 1in;

is eventually parsed as

background-position: 1in 50%;

and percentage is rendered according to the following logic:
"
With a value pair of '14% 84%', the point 14% across and 84% down the
image is to be placed at the point 14% across and 84% down the padding
box.
"

So, the vertical middle point of support/black15x15.png image should be
positioned at the vertical middle point of the padding box of its
element.
15px must be divided by 2 to get such vertical middle point and then
position the image at pixel 48 of padding box. So, there we have a
fractional pixel issue and it could be at pixel 7 (rounded down) or
pixel 8 (rounded up) of the black15x15.png.


format issue
------------

There is a format/code issue with all these tests: they all position a
background-image inside one single element. There is no need at all for
these tests to be using 2 divs.

How to correct these tests? Obviously, the image dimensions should
have/use even numbers. And then all the tests divs' widths should be
recalculated. Since these 12 tests use the same design logic and code,
then the same fix could be done to all tests.


Proposed replacement (eg. for background-position-019.xht) which fixes
all 3 issues
--------------------

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/background-position-019-GT.xht


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

CSS 2.1 Test suite RC6, March 23rd 2011:
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

CSS 2.1 test suite harness:
http://test.csswg.org/harness/

Contributing to to CSS 2.1 test suite:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Tuesday, 24 April 2012 00:00:29 UTC