Re: [css3-background] round(N+0.5) with background-repeat: round

On Tue, Mar 26, 2013 at 7:39 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> The spec for background-size has this text for when background-repeat is
> 'round':
>
>> If X ≠ 0 is the width of the image after step one and W is the width
>> of the background positioning area, then the rounded width X' = W /
>> round(W / X) where round() is a function that returns the nearest
>> natural number (integer greater than zero).
>
>
> What should round() do when two natural numbers are equally near? For
> example, with W = 250 and X = 100, should round(W / X) be 2 or 3?
>
> I suggest picking one arbitrarily (round <natural>+0.5 up or down), spec it,
> and add a test like one of these with 'width: 240px' (= 96*2.5)
>
> http://test.csswg.org/suites/css3-background/nightly-unstable/html4/background-repeat-round.htm
> http://test.csswg.org/suites/css3-background/nightly-unstable/html4/background-repeat-round-roundup.htm

I believe in other cases, we've explicitly specified that it rounds up.

~TJ

Received on Tuesday, 26 March 2013 17:21:45 UTC