W3C home > Mailing lists > Public > www-style@w3.org > June 2007

Re: [cssom] simple assignment involving !important

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 05 Jun 2007 14:33:54 +0200
To: "Mats Palmgren" <mats.palmgren@bredband.net>, www-style@w3.org
Message-ID: <op.ttf7uslh64w2qv@annevk-t60.oslo.opera.com>

On Mon, 04 Jun 2007 17:18:04 +0200, Mats Palmgren  
<mats.palmgren@bredband.net> wrote:
> Reading the 11 May draft of CSSOM I can't figure out
> how to deal with:
>
> obj.style.width = '1em !important'
>
> I suspect it should be rejected as an illegal value.
> It would be good if this case was explicitly clarified
> in the spec (either way).

Testing shows that Internet Explorer 7 does not support it and Opera 9 and  
Firefox 2 do... Given that .width is basically a shorthand for  
setProperty("width", setted value, null) I suppose what Internet Explorer  
7 does is more logical. Except that it throws an exception. It seems more  
natural to simply ignore the setting to maintain the forward compatible  
parsing rules of CSS.

Also, "setted value" above has to be parsed per the "S* expr" grammar from  
CSS 2.1 (or some superset of that if the browser supports more).

Would specifying something to that effect make sense? Probably indicating  
that including !important would lead to the method call being ignored?


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Tuesday, 5 June 2007 12:34:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:51 GMT