Re: [cssom] Methods instead of attributes for usedStyle et al

On Tue, 13 Aug 2013 21:34:52 +0200, Simon Pieters <simonp@opera.com> wrote:

> You're right. For some reason I thought getComputedStyle was static in  
> implementations, but it's live in WebKit/Blink/Gecko/IE10:
>
> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2448
>
> So the spec needs to be fixed to say that getComputedStyle is live.
>
> This information also means that the GetStyleUtils can be changed back  
> to attributes, and we can make them return the same live object each  
> time.

Done https://dvcs.w3.org/hg/csswg/rev/e605b1398664


> getComputedStyle returns a new object each time even if it gets invoked  
> with the same arguments in WebKit/Blink/Gecko, but not in IE10:
>
> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2449
>
> Does anyone have an opinion about which is better, or should I just go  
> with the majority? Is getComputedStyle often invoked with the same  
> arguments in a tight loop in the wild?

Or, on the flip side, is it often invoked with different arguments, but  
not multiple times with the same arguments?

Or both?

-- 
Simon Pieters
Opera Software

Received on Tuesday, 13 August 2013 20:09:02 UTC