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

The spec for background-size has this text for when background-repeat is 

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


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

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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:27 UTC