webref icon indicating copy to clipboard operation
webref copied to clipboard

Invalid `initial` value of some CSS descriptors

Open cdoublev opened this issue 2 years ago • 2 comments

Some descriptors are defined with an initial field value that is not a valid CSS value. If I am not mistaken, for each of them, the value should be internally resolved to undefined and should serialize to an empty string, eg. with CSSFontFaceRule.style.getPropertyValue(src) (yes, it is weird but already supported in Chrome at least).

Obviously, these initial values cannot be used, but I am not sure if you want to fix it on your side. I remove them, which is equivalent to defining them to undefined. But it may also be usefull to have a prose defining that the initial value is an undefined/invalid value instead of having an empty string. I am creating this issue to let you know about this, but feel free to close it.

  • @color-profile
    • components: n/a
    • src: n/a
  • @counter-style
    • additive-symbols: n/a
    • symbols: n/a
  • @font-face
    • font-family: N/A
    • src: N/A
  • @font-palette-values
    • base-palette: N/A
    • font-family: N/A
    • override-colors: N/A
  • @property
    • inherits: n/a (see prose)
    • initial-value: the guaranteed-invalid value (but see prose)
    • syntax: the guaranteed-invalid value (but see prose)

cdoublev avatar Aug 20 '22 19:08 cdoublev

Thanks for the list! We currently extract but don't check the initial value at all. It would seem a good idea to drop initial when value is n/a. There are similar problems in the list of properties, e.g. those where initial is set to "See individual properties".

tidoust avatar Aug 22 '22 09:08 tidoust

There are similar problems in the list of properties, e.g. those where initial is set to "See individual properties".

These are all shorthands, I think. I also remove them. I know that sometimes, a shorthand is defined with a valid CSS value, though, which is weird (or even incorrect) because a shorthand have no declaration internally stored: the value of a shorthand is resolved from the declarations values for its longhands.

cdoublev avatar Aug 22 '22 13:08 cdoublev