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

On Thursday 2013-01-31 18:11 -0800, Tab Atkins Jr. wrote:
> On Thu, Jan 31, 2013 at 5:43 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> > On 1/31/13 8:18 PM, Tab Atkins Jr. wrote:
> >> Next step is figuring out if there is implementor interest in exposing
> >> this information, and then someone writing it up in the CSSOM spec.
> >
> > This information being specified/cascaded style values?
> >
> > There's certainly interest from me.  ;)
> 
> 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.
> 
> Thoughts?

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

-David

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

Received on Friday, 1 February 2013 02:26:10 UTC