W3C home > Mailing lists > Public > www-style@w3.org > March 2009

RE: setting css property to empty string from script

From: Mike Wilson <mikewse@hotmail.com>
Date: Fri, 6 Mar 2009 20:31:28 +0100
Message-ID: <BAY116-DAV1D7AE9F8D2F7E7AAC61FFA4A50@phx.gbl>
To: "'Giovanni Campagna'" <scampa.giovanni@gmail.com>, "'Daniel Glazman'" <daniel.glazman@disruptive-innovations.com>, "'Boris Zbarsky'" <bzbarsky@MIT.EDU>
Cc: "'www-style'" <www-style@w3.org>
Message-ID: <03c001c99e92$257e2e50$0a01a8c0@mikedeskxp>
Thanks for all input! 

Daniel Glazman wrote on 6 mars 2009 18:56:
> Please note that the Web heavily relies on this behaviour. Call it
> a 'de facto' standard :-)

Very much agreed! We were discussing it earlier today and I realized 
I hadn't looked for it in the specs before...

Giovanni Campagna wrote on 6 mars 2009 18:59:
> It also looks like that, according to future versions of CSSOM:
> - If value is null or the empty string invoke removeProperty with
> property as argument and abort this algorithm.
> http://dev.w3.org/csswg/cssom/#cssstyledeclaration-setproperty

Ah thanks, that makes sense. There's always another spec ;-)
I'm happy it is becoming officially speced.

Best regards

> Mike Wilson wrote on 6 mars 2009 17:51:
> > When you have overrided the value of an element's CSS attribute
> > through script, then you can reset the attribute back to the 
> > value governed by style declarations by assigning the empty 
> > string.
> > <snip>
> > Is this behaviour specified by any standard, or is it just a
> > convention implemented by UAs? (I don't find it but maybe I am
> > not looking in the right places.)
Received on Friday, 6 March 2009 19:32:28 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:24 UTC