W3C home > Mailing lists > Public > www-style@w3.org > May 2010

Re: [css3-background] background-size and zero length

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 12 May 2010 01:02:50 -0700
Cc: Sylvain Galineau <sylvaing@microsoft.com>, Boris Zbarsky <bzbarsky@MIT.EDU>, "www-style@w3.org" <www-style@w3.org>
Message-Id: <EC3687CC-D56A-47EC-BCB0-8AC0A116C9EF@gmail.com>
To: Brian Manthos <brianman@microsoft.com>

On May 12, 2010, at 12:23 AM, Brian Manthos wrote:

> div {
> 	background: url(http://www.microsoft.com/favicon.ico) / 0.00833333330px 100px aqua;
> 	/* Cover IE with Microsoft wallpaper; hide it in Firefox. */
> 	background-size: 100px 100px;
> 	height: 100px;
> 	width: 100px;
> }
> 
> Note that this example doesn't apply directly today because neither Opera nor Firefox appear to support background-size values in the background shorthand no matter what I attempt to throw at them.

In the WG f2f in Cupertino, we (the WG) agreed to some sort of silly restriction on when authors are allowed to use that slash in the shorthand. As I recall, you have to also include the background -position value(s) first, immediately before the slash.

But I'm not bitter or anything about losing that argument. 8Čb

> Namely, IE might see...
> div {
> 	background: url(http://www.microsoft.com/favicon.ico) / 0.00833333330px 100px aqua;
> 	background-size: 100px 100px; /* override the sizing */
> 	height: 100px;
> 	width: 100px;
> }
> 
> ... while Firefox would see ...
> div {
> 	background-size: 100px 100px; /* irrelevant, no image specified */
> 	height: 100px;
> 	width: 100px;
> }

That doesn't track with me. Why would FF throw out the whole shorthand? A zero width image is valid, even if it is invisible. It might even be useful with transitions, for transitioning the size to or from zero. It's just not roundable at zero, and you can fit an infinite number of them on the head of a pin (so don't bother drawing it until it is non-zero).

Received on Wednesday, 12 May 2010 08:03:26 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:27 GMT