Re: [cssom] simple assignment involving !important

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 UTC