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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 26 Mar 2013 10:20:57 -0700
Message-ID: <CAAWBYDC=uVv_q2C_j1P4Rd9xTbjeLSc+OvB=wsgwbR0TSkVk-w@mail.gmail.com>
To: Simon Sapin <simon.sapin@exyr.org>
Cc: www-style list <www-style@w3.org>
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 GMT

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