W3C home > Mailing lists > Public > public-css-testsuite@w3.org > November 2012

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

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Wed, 14 Nov 2012 21:27:07 -0500
Message-ID: <c8ea4ec86a6f9ff9df0189eb88771985.squirrel@ed-sh-cp3.entirelydigital.com>
To: "Zhang, Zhiqiang" <zhiqiang.zhang@intel.com>
Cc: "Public CSS testsuite mailing list@w3.org" <public-css-testsuite@w3.org>, "Santos, Thiago" <thiago.santos@intel.com>, "Zhang, Haili" <haili.zhang@intel.com>, "Yu, Ling L" <ling.l.yu@intel.com>, "Yang, Lei A" <lei.a.yang@intel.com>
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
> reviewed again, and to be approved :).


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 /
            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 ==

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.



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





This test is more difficult than it may seem.

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

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.

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

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



            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!

Contributions to the CSS 2.1 test suite:

CSS 2.1 Test suite RC6, March 23rd 2011:

CSS 2.1 test suite harness:

Contributing to to CSS 2.1 test suite:
Received on Thursday, 15 November 2012 02:27:41 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:13:25 UTC