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

Hi,

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


Alternatively, if we want to leave this undefined, mark it explicitly as 
such. (Though I’d prefer to avoid this.)

Cheers,
-- 
Simon Sapin

Received on Tuesday, 26 March 2013 14:39:56 UTC