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

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

From: Gérard Talbot <css21testsuite@gtalbot.org>
Date: Thu, 15 Nov 2012 00:24:20 -0500
Message-ID: <c36808fed8871baaf68d6384df11db2b.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 Mer 14 novembre 2012 21:27, "Gérard Talbot" a écrit :
> 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.

I am working on other images which would avoid creating fractions in
calculations and when rescaling and which could be reliable and helping
human testers notice test failures. It's not as easy as one might think.

Top and left sides of such images should be with a distinct color and/or
distinct pattern. Right and bottom sides of such images should use
another distinct color and/or distinct pattern. That way, an human
tester would see if a 1px is missing at right and/or bottom and if 1px
is incorrectly repeated at right and/or bottom. When the
background-size: with round value fails, then it is because there is a
partially displayed image on the right and/or at the bottom. So, this
explains the need to have differentiable color and/or pattern for the

> -------------
> 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.

Firefox currently does not support background-repeat: round according to:
and to some basic tests.

>>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!

IE10 renders it like Opera: there is 1px missing.



            So, the rounded width of the image is 65.3px, [196px /
rounded (196px / 60px)]
            and the height is rescaled to 66.0px to keep the original
aspect ratio.

The design logic of background-size-029.html is correct; the problem is
the fraction of pixel. If 65.3px is rounded down as actual value, then
we may well see a 1px extra of the cat image on the right. This is
exactly what happens in Opera 12.10 under Linux KDE 4.9.3 and such
rendering by Opera is correct, is not wrong. Now, a very strict tester
(or a software) would say that there is a partially displayed cat image
in the page...

Thursday and Friday (nov. 15 and 16), I will continue to work on making
your background-size-[025-034] tests more accurate and not creating
fractional pixel. I'm sure I am getting close to fixing that issue.

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 05:24:51 UTC

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