Re: [css-variables] parse-time error handling in uses of variables

On Thu, Dec 6, 2012 at 2:11 AM, François REMY
<francois.remy.dev@outlook.com> wrote:
> I've an issue with this proposal. I know that this is mostly what the current specification says, but I would prefer the validation algorithm of Token Stream References to match the one of Attribute References.

This is unacceptable for several secondary use-cases for Variables,
namely using a CSS variable in JS to effectively get a "DOM-tree
scoped" JS variable, and using CSS variables as "author-prefixed"
properties that are preserved by the engine and used for polyfills.

Further, there doesn't seem to be much use in this even for pure CSS
uses of Variables.  attr() validates its fallback value at parse time
*so that it will either be discarded at parse time or guaranteed valid
at computed time*.  Even if the fallback is omitted, because we know
the value's intended type, we can provide a default fallback that will
be valid for use in that position.  We have no such ability for
Variables, so enforcing a validity requirement that doesn't even buy
us guaranteed validity seems low-value.

~TJ

Received on Friday, 7 December 2012 17:07:39 UTC