Re: [css-om][css-variables] exposing variables through CSSStyleDeclaration

On Wed, 28 Aug 2013 03:37:32 +0200, Cameron McCormack <cam@mcc.id.au>  
wrote:

> Tab Atkins Jr. wrote:
>> They are exposed as such.  Note that the CSSVariablesMap interface
>> operations all indirect through getProperty/setProperty.
>
> OK.
>
> CSSOM currently says this:
>
>    The term supported CSS property refers to a CSS property that the
>    user agent implements, and that is defined to be a case-insensitive
>    property in the CSS specification. A supported CSS property must be
>    in its lowercase form for the purpose of comparisons this
>    specification.
>
>    CSS properties that are case-sensitive such as CSS Variables are
>    author-defined and are represented with dedicated interfaces, and do
>    not participate in the base CSSOM API.
>
> I had misread thinking that getPropertyValue returns early if it's given  
> a property name that is not a supported CSS property, but instead it  
> looks for "a property of a declaration in the declarations" so that  
> should be OK.
>
> setProperty, however, does say:
>
>    3. If property is not a case-sensitive match for a supported CSS
>       property, terminate this algorithm.
>
> so you wouldn't be able to to use it with a custom property.

The CSSOM spec is probably wrong when it comes to how to deal with  
variables. I'll look into fixing it.

I'm not sure what getComputedStyle should do. I guess include all  
"supported CSS properties" (i.e. excluding variables) and then include the  
specified variables.

-- 
Simon Pieters
Opera Software

Received on Wednesday, 28 August 2013 08:35:48 UTC