W3C home > Mailing lists > Public > www-style@w3.org > January 2011

Re: [css3-background] Question on background-repeat: round

From: Leif Arne Storset <lstorset@opera.com>
Date: Mon, 17 Jan 2011 11:15:07 +0100
To: www-style@w3.org, Cathy.Chan@nokia.com
Message-ID: <op.vpf6rgvetmo5g6@nynorsk>
<Cathy.Chan@nokia.com> skreiv Fri, 14 Jan 2011 20:54:42 +0100

> The spec provides the following formula for computing the background  
> size when background-repeat is ‘round’ for one or both dimensions  
> (http://www.w3.org/TR/css3-background/#the-background-size):
> [[
> 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).
> ]]
> My understanding of the "nearest natural number" is that it could be  
> smaller than or larger than the given number. Thus, 2.4 should round  
> (down) to 2, whereas 2.7 should round (up) to 3.
> However, the examples seem to imply that rounding is always in the "up"  
> direction to the next natural number, which is not necessarily the  
> nearest.

The spec was changed back in 2009 [0], but the examples have not been  
updated to reflect the change. I'm guessing the editors will take in your  
suggested corrections.

Not that it would have helped in this case, but often the Editor's Draft  
[1] is a better reference to use for a draft spec.

1. http://dev.w3.org/csswg/css3-background/#background-size

Leif Arne Storset
Core Technology Developer, Opera Software
Oslo, Norway
Received on Monday, 17 January 2011 10:15:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:54 UTC