W3C home > Mailing lists > Public > www-style@w3.org > February 2012

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

From: Aryeh Gregor <ayg@aryeh.name>
Date: Thu, 2 Feb 2012 15:16:10 -0500
Message-ID: <CAKA+AxnFCs=QJL7SXOg7mYXXB7M=Diz_gShUGvgxxQgBB-b7gw@mail.gmail.com>
To: HÃ¥kon Wium Lie <howcome@opera.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, fantasai <fantasai.lists@inkedblade.net>
Cc: www-style@w3.org
Test-case:

data:text/html,<div style="height:100;width:100;background:gold"></div>

In IE10 Developer Preview, Firefox 13.0a1, Chrome 18 dev, and Opera
Next 12.00 alpha, "100" is interpreted as "100px" and you see a gold
box.  If you add <!doctype html>, the box vanishes, because "100" is a
parse error.  This quirk is interoperably implemented and seems to
apply to all properties that accept a length, so it needs to be
documented somewhere.  Values and Units seems like the right place.
The effect for properties that accept both <length> and <number>, like
line-height, needs to be called out explicitly.

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.  This also needs to be standardized one way or the other.
Received on Thursday, 2 February 2012 20:17:01 GMT

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