[csswg-drafts] [css-animation-1] Limit keyframe rule to `@keyframes` context (#7604)

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

== [css-animation-1] Limit keyframe rule to `@keyframes` context ==
This seems to be a minor problem but... I cannot find some definitions that prevents this:

```css
@media all {
  from { translate: 0px; } /* keyframe rule */
}
```

In CSS Syntax 3, [`<stylesheet>`](https://drafts.csswg.org/css-syntax-3/#typedef-stylesheet) (the block value type of `@media`) is defined as:

> the `<stylesheet>` production represents a list of rules. It is identical to `<rule-list>`, except that blocks using it default to accepting all **rules that aren’t otherwise limited to a particular context**.

> For rules that use `<stylesheet>`, all rules are allowed by default, but **the spec for the rule may define what types of rules are invalid inside the rule**.

CSS Animation 1 does not limit `<keyframe-block>` (keyframe rule) to `@keyframes` and CSS Conditional 3 does not prevents `@media` from containing `<keyframe-block>`.

If I'm not mistaken, the issue is also valid for `@supports` and/or margin rules. 

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


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

Received on Sunday, 14 August 2022 13:28:46 UTC