[csswg-drafts] [css-animation-1] Should non-animatable properties be accepted in keyframe rules? (#10342)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-animation-1] Should non-animatable properties be accepted in keyframe rules? ==
https://drafts.csswg.org/css-animations-1/#keyframes

  > The `<declaration-list>` inside of `<keyframe-block>` accepts any CSS property except those defined in this specification [...]

... but not all those defined as [non-animatable](https://www.w3.org/TR/web-animations/#not-animatable).

For example, in Chrome and FF:

```js
keyframe.style.setProperty('animation-time', '1s')
keyframe.style.animationTime; // undefined
keyframe.style.setProperty('contain', 'strict')
keyframe.style.contain; // 'strict'
```

Why authors can declare `contain` but not `animation-time`? Should all non-animatable properties be invalid in keyframe rules?

This in-between state seems odd, and the behavior for `.setProperty()` with `animation-time` (explicitly not accepted) is [unspecified](https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-setproperty).

I assume that `CSSKeyframeRule.style` is not defined with its own interface inheriting from `CSSStyleDeclaration` because 600+ animatable properties would then need to be defined as its attributes.

An alternative (that I do not like, fwiw) would be to define `CSSKeyframeProperties` as inheriting from `CSSStyleProperties` and do a no-op in the appropriate methods for non-animatable properties.

Related: #2736, #9453

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10342 using your GitHub account


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

Received on Thursday, 16 May 2024 13:00:36 UTC