W3C home > Mailing lists > Public > www-style@w3.org > March 2013

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

From: Simon Sapin <simon.sapin@exyr.org>
Date: Tue, 26 Mar 2013 15:39:32 +0100
Message-ID: <5151B324.1060000@exyr.org>
To: www-style@w3.org
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT