Re: [css3-values] Browsers allow unitless lengths in quirks mode

On 2/2/12 3:16 PM, Aryeh Gregor wrote:
> There are probably other quirks like this too.  For instance:
>
> data:text/html,<div style="background:00ff00; height:100;width:100"></div>
>
> This displays a lime box in IE, Chrome, and Opera, although not
> Firefox.

The only reason it doesn't in Firefox is that you used "background", not 
"background-color".  Gecko doesn't do the "drop the '#'" in shorthands, 
since that can introduce parsing ambiguities.

The length quirk has the same thing going on; if you try "border: 1 
solid black" in Gecko it won't work.

For what it's worth, the full list of CSS parser quirks-mode behaviors 
Gecko has is:

1) Unitless lengths allowed in longhands only.
2) Hex colors without leading '#' allowed in longhands only.
3) Braces around the value of the "style" attribute allowed.

-Boris

Received on Thursday, 2 February 2012 20:32:35 UTC