W3C home > Mailing lists > Public > www-style@w3.org > July 2008

Re: [CSSOM] Can we have a .computedStyle in ElementCSSInlineStyle

From: L. David Baron <dbaron@dbaron.org>
Date: Sun, 13 Jul 2008 12:15:53 -0700
To: Garrett Smith <dhtmlkitchen@gmail.com>
Cc: Francois Remy <fremycompany_pub@yahoo.fr>, CSS 3 W3C Group <www-style@w3.org>
Message-ID: <20080713191553.GA31301@pickering.dbaron.org>

On Saturday 2008-07-12 16:06 -0700, Garrett Smith wrote:
> >> However, I'd note that there may be value in two different forms of
> >> specified style:
> >>
> >> * a CSSStyleDeclaration that has all properties specified in author
> >>  style sheets
> >>
> >> * a CSSStyleDeclaration that has all properties specified at all
> >>  levels of the cascade
> >>
> >> I think the first of these would be preferable for editing-type
> >> tasks (manipulating markup intended to be used later).  The second
> >> would be a little more like getComputedStyle.
> >
> 
> You lost me on that one. What was it you were trying to explain?

I was saying it might be worth having two different APIs.  Let's
call them (for purposes of this example; I think these are bad
names) element.authorSpecifiedStyle and element.allSpecifiedStyle.

An example to show the difference between the two:  if the UA style
sheet has:
  h1 { font-weight: bold; font-size: 200%; }
and the page's style sheet has:
  h1 { text-decoration: underline; }
then:
  element.authorSpecifiedStyle.textDecoration == "underline"
  element.allSpecifiedStyle.textDecoration == "underline"
  element.authorSpecifiedStyle.fontWeight == ""
  element.allSpecifiedStyle.fontWeight == "bold"

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Sunday, 13 July 2008 19:16:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:10 GMT