background-size-[025-028]: more feedback

Le Ven 9 novembre 2012 3:28, Zhang, Zhiqiang a écrit :
>> Zhiqiang, let me know if you have more tests (and which tests) to
review, to approve.
>> Gérard
>> --
> Hi Gerard,

> background-size-002 to 034 (except background-size-008 above) need to
be
> reviewed again, and to be approved :).

http://test.csswg.org/source/contributors/intel/submitted/css3-background/background-size-025.html

background-size-025: we want tests to avoid fractional pixels all the
time. Sub-pixel positioning is not required by user agents. I believe we
need some other images besides cat.png. The 2 problems with cat.png is
that 98px wide by 99px tall is likely to create fractions of pixel as
those numbers are difficult to divide without causing fractions; the
image itself does not fully fill both dimensions of the rectangle.


Also, this comment seems wrong:

"
So, the rounded height of the image is 66.6px, [200px / rounded (200px /
60px)]
            and the width is rescaled to 60.0px to keep the original
aspect ratio.
"

The width should be rescaled to 98px mult 66.66667 divided by 99px ==
65.993px

The test logic is correct and acceptable. It is just that we don't know
and we can not predict the actual dimensions (it could be 66px or 67px
or 66.6px or 66.7px) and therefore there can be a partially displayed
cat of 1px horizontally and of 1px vertically: this is actually what
happens too in Opera 12.10. And 1px multiplied by 3 cats == 3px.

I've just checked background-size-025.html on IE10 and it seems there is
a loss of 2px for the right-most cats (3rd column) and a loss of 2px for
the bottom-most cats (last row).

Conclusion: we need another image besides cat.png and we need values
that will avoid creating fractions in calculations and when rescaling.

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

http://test.csswg.org/source/contributors/intel/submitted/css3-background/background-size-026.html

A reftest for this test is doable, possible, available:

http://www.gtalbot.org/BrowserBugsSection/review/reference/background-size-026-ref.xht

Approved.

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

http://test.csswg.org/source/contributors/intel/submitted/css3-background/background-size-027.html

This test is more difficult than it may seem.

            background-repeat: repeat round;
            background-size: 60px auto;
            height: 180px;
            width: 180px;

1-
background-size: 60px auto:
"
An 'auto' value for one dimension is resolved by using the image's
intrinsic ratio and the size of the other dimension
"
If intrinsic ratio is 1:0.989 (1:[intrinsic width/intrinsic height]),
then the image is rescaled to the dimensions 60px wide and 60.61px tall.

2-
Then, background-repeat: repeat round adds an extra step:

Newest height = 180px / round (180px / 60.61px);
Newest height = 180px / round (2.955);
Newest height = 180px / 3;
Newest height = 60px; /* to be repeated vertically a "round" number of
times */


So, before being repeated vertically, the image height should be
rescaled again from 60.61px to 60px.

Right now, Firefox 16.0.2 under Linux KDE 4.9.3 and Firefox 19a1 under
Windows XP SP3 fail background-size-027 by one pixel and I am not sure
why.

>From 99px to 60.61px to 60px, calculations and handling of fractions
could cause a 1px to be loss somewhere.

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

http://test.csswg.org/source/contributors/intel/submitted/css3-background/background-size-028.html

"
            So, the image should be rescaled to 49px by 49.5px
            and be repeated four times in horizontal and vertical.
"


Firefox 16.0.2, Opera 12.10 and Chrome 23.0.1271.64 (all under Linux KDE
4.9.3) fail this test because of fractional pixel in height. Either the
cat images are not perfectly identical (Firefox) or there is a tiny
extra 1px missing (Opera) or a tiny extra 1px shown (Chrome): 3
different renderings!

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 Thursday, 15 November 2012 02:27:41 UTC