Re: Element.style setter

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 UTC

AltStyle によって変換されたページ (->オリジナル) /