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

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 UTC