Re: [cssom] Defining getComputedStyle

Just wanted to reply to some questions before I leave for food, hope that  
helps :-)

On Fri, 12 Feb 2010 19:03:04 +0100, Sylvain Galineau  
<sylvaing@microsoft.com> wrote:
> The first set of properties has no resolved value. I assume the implied  
> rule is that shorthands don't get resolved ?

That was the idea, but I think what dbaron proposed is better. I.e. that  
we return something for shorthand properties as well as more properties  
may evolve into being shorthand properties in the future.


> For the last two sets of properties - height...width and 'any other  
> property - the resolved value either may or is the computed value. As  
> the section begins with :
>
> "However, the concept of "computed value" changed between revisions of  
> CSS while the implementation of getComputedStyle() had to remain the  
> same for compatibility with deployed scripts."
>
> ...I assume the computed value being returned here is the computed value  
> as defined by CSS, not the one getComputedStyle() has to keep returning  
> for backward compatibility ?

Right, it is the computed value as defined by CSS 2.1. Maybe I should  
simplify the introduction by stating that for some properties it does  
something different for historical reasons, without trying to go into  
detail.


> I expected the spec to define what getComputedStyle() returned but  
> couldn't locate it. All I found was that :
>
> "The getComputedStyle method MUST return a live CSSStyleDeclaration  
> object that contains the computed style declaration block for elt..."
>
> Shouldn't we define how that style declaration block is computed for  
> completeness and coherence ?

Do you mean the serialization of each value? That I have yet to define. I  
also should make it more clear that the style declaration block returned  
needs to have the resolved value for each property the user agent supports  
and that if the element is removed from the DOM all properties return the  
empty string.


Thanks for the feedback!


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Friday, 12 February 2010 18:37:00 UTC