Re: [csswg-drafts] [css-variables] Substitution of invalid variables into other variables (#5370)

> Implicitly, this is recognizing that the guaranteed-invalid value actually is "valid" in some circumstances; it's guaranteed to never match the grammar of any predefined CSS property, but it's part of the value space (and thus, matches the grammar) of unregistered custom properties, or registered ones with unrestricted grammar.

When you put it like that, it makes sense to me too.

It would mean that any property that is IACVT becomes:

- _guaranteed-invalid_ if that value is permitted by the grammar of the property, or
- `unset` in all other cases

If we are recognizing guaranteed-invalid as "valid" in some cases, we must IMO also recognize that it's not permissible in all other cases. This has some consequences for _cyclic at computed value time_. We currently assign guaranteed-invalid to _all_ custom properties in a cycle, regardless of their grammar. With this new way of thinking about guaranteed-invalid, we could only assign this value to custom properties which support it. In other words, non-universal registered custom properties in a cycle would become `unset`, which is a change from how it currently works. Basically I think we could just remove the _cyclic at computed value time_ definition, and merge it with IACVT.

What bugged me initially in #4075 was the inconsistency that standard properties behaved in one way and custom propeties in another for no apparent reason. But the new model would "explain" the difference via what is allowed by the grammars, which seems satisfactory to me. (So even a standard property could in theory become guaranteed-invalid if it explicitly allowed it for some reason).

I'm not sure how easy it is to make this change given that all browsers currently agree on the behavior. I'm also not thrilled about doing a 180. But since it seems to be what everyone wants, and I'm warming up to the idea myself, I suppose we could try. :man_shrugging:


-- 
GitHub Notification of comment by andruud
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5370#issuecomment-667004107 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 31 July 2020 08:31:38 UTC