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

On Thu, Jan 31, 2013 at 6:25 PM, L. David Baron <dbaron@dbaron.org> wrote:
> I'd actually rather have separate methods or (probably preferably)
> getters for each sort of value we'd want to return (the set is
> pretty small) than have string arguments for "specified",
> "computed", etc.
>
> For example, maybe something like:
>   element.specifiedStyle.color
>   element.computedStyle.color
>   element.usedStyle.color
>   element.pseudoStyle("::before").specifiedStyle.color

Hm, that seems quite nice.  Are you okay with the actual property
accessors being lazy, so you don't necessarily have to do a lot of
value computation up-front?

For the last one, this could give us an excuse to finally reify
pseudo-elements as DOM constructs, for the return value of your
pseudoStyle() function (though I'd call it something else).

~TJ

Received on Friday, 1 February 2013 02:34:56 UTC