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

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

0.  
http://dev.w3.org/cvsweb/csswg/css3-background/Overview.html.diff?r1=1.157&r2=1.158
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