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

On Thursday 2013-01-31 18:34 -0800, Tab Atkins Jr. wrote:
> 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?

I think I would object to them being other than lazy.

> 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).

Hmmm.  That scares me a bit; I hadn't intended that.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂

Received on Friday, 1 February 2013 02:41:46 UTC