Re: [csswg-drafts] [css-fonts-4] Missing restrictions of multi-valued feature values (#9926)

I think the introduction of `@historical-forms` and `CSSFontFeatureValuesRule.historicalForms` was an accident.

I would not mind if the syntax was a little stricter. For example, if I understand the semantics correctly, by replacing...:

  > *Each declaration’s value must match the grammar `<integer [0,∞]>+`, or else the declaration is invalid and must be ignored.

...with:

  > Each declaration’s value in `@annotation`, `@ornaments`, `@stylistic`, `@swash`, must match the grammar `<integer [0,∞]>`, or else the declaration is invalid and must be ignored.
  >
  > Each declaration’s value in `@character-variant` must match the grammar `<integer [0,99]> <integer [0,∞]>`, or else the declaration is invalid and must be ignored.
  >
  > Each declaration’s value in `@styleset` must match the grammar `<integer [0,20]>+`, or else the declaration is invalid and must be ignored.

---

***Aside***

I noticed that Chrome sets a feature value to `0` when more than the limited number of values is provided with `CSSFontFeatureValuesMap`. For example:

```js
rule.characterVariant.set('alpha-2', '1 2')
rule.characterVariant.get('alpha-2') // [0]
```

But the spec currently requires throwing `InvalidAccessError`, and this seems inconsistent with other interfaces that allow to set a declaration value.

Should it also align with this behavior? Should I open a separate issue?

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


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

Received on Monday, 25 March 2024 05:24:45 UTC