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

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

From: Simon Pieters <simonp@opera.com>
Date: Wed, 28 Aug 2013 10:41:40 +0200
To: "Tab Atkins Jr." <jackalmage@gmail.com>, "Cameron McCormack" <cam@mcc.id.au>
Cc: "www-style list" <www-style@w3.org>
Message-ID: <op.w2iqfqvgidj3kv@simons-macbook-pro.local>
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:33 UTC