W3C home > Mailing lists > Public > www-style@w3.org > February 2013

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

From: L. David Baron <dbaron@dbaron.org>
Date: Thu, 31 Jan 2013 18:25:44 -0800
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, www-style list <www-style@w3.org>
Message-ID: <20130201022544.GA20379@crum.dbaron.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:05 GMT