W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2012

Re: Element.style setter

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 31 Aug 2012 11:26:04 -0400
Message-ID: <5040D78C.6090109@mit.edu>
To: www-dom@w3.org
On 8/31/12 8:24 AM, Bjoern Hoehrmann wrote:
> Allowing this results in odd situations like `a != b` right
> after setting `a = b`

This is already all over the web platform.  First of all, every case 
with [PutForwards] (which is how one would implement the behavior in 
question).  An existing example:

   window.location = "http://something";
   alert(window.location);  // alerts "object"

Or even in the CSSOM:

   div.style.color = "red";
   div.style.color = "oh, you want equality?"
   alert(div.style.color); // alerts "red"

or in the DOM:

   div.innerHTML = "<span>foo"
   alert(div.innerHTML); // alerts "<span>foo</span>"

Just saying.  If we really wanted to do this, implementing it in the web 
platform would be pretty straightforward: toss [PutForwards=cssText] on 
the .style attribute, and WebIDL will take care of the rest....

I'm not entirely convinced we do want to do it, though I'm not entirely 
unconvinced either.

-Boris
Received on Friday, 31 August 2012 15:26:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 31 August 2012 15:26:41 GMT