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

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

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Wed, 12 May 2010 14:05:27 +0000
To: Brian Manthos <brianman@microsoft.com>, Boris Zbarsky <bzbarsky@MIT.EDU>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <045A765940533D4CA4933A4A7E32597E2148B392@TK5EX14MBXC120.redmond.corp.microsoft.com>
Right. So your concern is entirely within the realm of: "what is the set of values that are treated like zero, why and how ?"

Your initial example specified 0px, not 0.0083333px. So I don't see anything special about *that* case i.e. when I say *at zero*,
I really mean *at* zero as specified in the stylesheet. There is nothing ambiguous in that case.

As for computing/resolving to zero, this is not just box-shadow or background-size: it's unspecified across CSS.

Do we know of scenarios where it is, or will be an issue for authors ? I don't expect there has ever been interop in this area
and yet I am unable to find bugs about it. In the absence of standard rules, no testcases check for it either.

Not that it wouldn't be beneficial to harmonize once and for all. But it'd also be good to understand why it's never been addressed.
From: Brian Manthos
Sent: Wednesday, May 12, 2010 12:23 AM
To: Sylvain Galineau; Boris Zbarsky
Cc: www-style@w3.org
Subject: 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 14:06:08 UTC

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