Re: [cssom] Proposal for obtaining robust style information via Javascript - getStyle()

On Thu, Jan 31, 2013 at 6:21 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 1/31/13 9:11 PM, Tab Atkins Jr. wrote:
>> In that case, let's get this done.  Francois' outline of a solution
>> earlier in this thread sounds great to me.  The only thing I'd change
>> is to make the property name optional too, in which case it's
>> identical to calling getComputedStyle() on the element.
>
> So it returns a string if you pass in the property name but a random live
> object if you don't?

Wait, getComputedStyle is a live object?  Jeezus.  Nah, let's just
return a dead object.  It's for when you do need to request multiple
properties, without having to retype the function multiple times (or
get the UA to recompute things multiple times, if it can save effort
by combining things).

> Also, in terms of argument order, I would think that the type of style would
> be specified more often than a pseudo-element, but maybe I'm wrong...

Yeah, Mike's proposal swaps the order as well.  Probably good to do.
Alternately: arguments object.

~TJ

Received on Friday, 1 February 2013 02:24:30 UTC