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

> Ultimately, I guess I don't understand how background-size: 0px 20px; is
> logically any different or weirder than a 0x0 background image.

I think they're both awkward and troubling.

IMO, either the trend should be to stop making behavioral branching part of the specification near-zero OR the behavior of numbers near-zero needs to be explicitly covered in CSS specifications.

Having the behavior branch "somewhere near zero, UA-defined how near" is a recipe for failure if we care about interoperability among implementation vendors.


> But what's special about background-size *at* zero as in your example ?
> The result of a 0px width and/or height is not special to this property or inconsistent with that of zero widths/heights/lengths elsewhere.

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.

But let's assume they support the shorthand-based specification of background-size values in the future.  If Firefox maintains the current behavior for values less than 0.00833333331px, then the treatment of that markup will be the same in the future.

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;
}


Thus the background-image value would be 'unset' for Firefox and 'set' for IE, and the user would experience backgrounds in one of the two browsers but not the other.

Such oddities are the enemy of interoperability.



I consider it undesirable that content authors have this flexibility within the background-size property.


Nonetheless, I'm apparently in the minority so it seems like it's not worth discussing further at this time.

Received on Wednesday, 12 May 2010 07:24:23 UTC