Validation errors in amp-keyframes
What's the issue?
Keyframes rules that validate when included in the amp-custom style tag do not validate when included in the amp-keyframes style tag.
This is valid in the amp-custom tag
@keyframes move { 0% { transform: translate3d(-297px, 0px, 0px); -webkit-transform: translate3d(-297px, 0px, 0px); -moz-transform: translate3d(-297px, 0px, 0px); animation-timing-function: linear; } 100% { transform: translate3d(0px, 0px, 0px); -webkit-transform: translate3d(0px, 0px, 0px); -moz-transform: translate3d(0px, 0px, 0px); } }
But fails validation when included in the amp-keyframes tag citing an invalid property for -webkit-transform -moz-transform animation-timing-function
What browsers are affected?
N/A
Which AMP version is affected?
N/A
/cc @Gregable @honeybadgerdontcare
Hm, the original request from @dvoytenko was to be more restrictive in amp-keyframes than in amp-custom. The allowed css declarations are currently restricted to:
allowed_declarations: "offset-distance"
allowed_declarations: "opacity"
allowed_declarations: "transform"
allowed_declarations: "visibility"
It seems likely that we want to also allow the vendor specific versions of these, even though we don't currently. However, I'm not sure about animation-timing-function. Dima, can you help us sort out what should make the cut here?
The animation-timing-function should definitely be included, I must have missed it. However, others are just vendor variants of transform. I'm pretty sure it has come up. But if not - let's add all prefixes for both transform and offset-distance.
So, don't add vendor prefixes for opacity?
If more convenient (and probably more proper way) is to strip any vendor prefixes from a CSS property and then test the "canonical" form against the "canonical" whitelist. That being said, no one ever uses -webkit-opacity form.
Fixed. I'll update the issue when it's released.
The prefix stripping is now live for the validator. However, animation-timing-function is being fixed in #13117 and will be live in several weeks.