I'm not sure the Comment 0 is entirely correct, if we're using a registered property From https://drafts.csswg.org/css-variables/#using-variables:~:text=To%20replace,result%2E : > […] > 2. Substitute arbitrary substitution functions in first arg, then parse it as a <custom-property-name>. If parsing returned a <custom-property-name>, **let result be the computed value of the corresponding custom property **on el. **Otherwise, let result be the guaranteed-invalid value**. > […] > 4. **If result contains the guaranteed-invalid value**, and second arg was provided, set result to the **result of substitute arbitrary substitution functions on second arg**. And from https://drafts.csswg.org/css-variables/#typedef-custom-property-name : > The CSS-wide keywords can be used in custom properties, with the same meaning as in any another property. So the reason for the Comment 0 case is more because of https://drafts.csswg.org/css-variables/#guaranteed-invalid: > The initial value of a custom property is a guaranteed-invalid value. (but for registered custom properties, we may have an actual value) --- So, for our case, I think we could check if we have a computed value for the variable (it seems that those invalid guaranteed invalid variables are not being displayed in the Computed panel, so we might already have what we need to properly identify those)
Bug 1904013 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I'm not sure the Comment 0 is entirely correct, if we're using a registered property From https://drafts.csswg.org/css-variables/#using-variables:~:text=To%20replace,result%2E : > […] > 2. Substitute arbitrary substitution functions in first arg, then parse it as a <custom-property-name>. If parsing returned a <custom-property-name>, **let result be the computed value of the corresponding custom property **on el. **Otherwise, let result be the guaranteed-invalid value**. > […] > 4. **If result contains the guaranteed-invalid value**, and second arg was provided, set result to the **result of substitute arbitrary substitution functions on second arg**. And from https://drafts.csswg.org/css-variables/#typedef-custom-property-name : > The CSS-wide keywords can be used in custom properties, with the same meaning as in any another property. So the reason for the Comment 0 case is more because of https://drafts.csswg.org/css-variables/#guaranteed-invalid: > The initial value of a custom property is a guaranteed-invalid value. (but for registered custom properties, we may have an actual value) --- So, for our case, I think we could check if we have a computed value for the variable (it seems that those invalid guaranteed invalid variables are not being displayed in the Computed panel, so we might already have what we need to properly identify those; note that it wouldn't work for variable in `@starting-style` rules as we don't get computed value, but that's an edge case we can handle in a follow up)