- From: John Daggett <jdaggett@mozilla.com>
- Date: Tue, 26 Feb 2013 20:36:22 -0800 (PST)
- To: www-style list <www-style@w3.org>
In section 4.2 of the CSS Variables spec [*], the CSSVariablesDeclaration interface defines a set of methods to get/set variable values. There's also an explicit delete method. The settor method's behavior is defined as: When asked to set or create the value of a variable, if varName matches the grammar of a custom property name: if varValue is the empty string, invoke the algorithm to delete a variable; otherwise, invoke setProperty() by passing varName as the property argument and varValue as the value argument. I don't think it's a good idea to have setting the variable to an empty string delete the variable, instead I think it should be treated as an invalid value. Otherwise, the behavior of the settor method will differ from setProperty and will be inconcrugent with setting other CSS property values where setting a property to an invalid value will retain the previous value. I also think you need to state clearly the behavior for invalid values (variables allow lots of syntax variations for values but there are some values that are invalid syntax). Plus, do these methods raise exceptions and, if so, which exceptions? Cheers, John Daggett [*] http://dev.w3.org/csswg/css-variables/#the-cssvariablesdeclaration-interface
Received on Wednesday, 27 February 2013 04:36:49 UTC