Re: [csswg-drafts] [css-animations] Clarify properties that are not allowed in @keyframes rule (#2736)

Moved from #10342 (duplicate of this issue)

  > 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

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2736#issuecomment-2115275397 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:37:30 UTC