Amphtml: Improve error message when keyframes are invalid

Created on 20 Feb 2019  路  5Comments  路  Source: ampproject/amphtml

What's the issue?

Cannot use TranslateY in animation

How do we reproduce the issue?

I have an animation translate-Y which is supposed to translate an element :

image

and I call it this way :

image

But then I have a JS error in the console :

image

I tried to inspect a little bit, and I found that in web-animation.js, in the init function :

image

What browsers are affected?

I experienced this issue on Chrome 71, Windows 10

Which AMP version is affected?

Version 1902151859190

amp-animation Developer When Possible Documentation Bug DevX components

All 5 comments

I'm not sure that is the cause of the error, but you need units for your translateY (e.g. -68px or -68% and not -68).

Indeed ,sorry for that !
Thanks

Reopening the issue for improving the error message, it should say something better than "Partial keyframes are not supported".

@sparhami I assigned this to you since you seem to have context, feel free to un-assign yourself 馃槃

This error message comes directly from the platform and is reflected by the polyfill as well.

If we believe the error can be written in a better way, we should specify that to the Chrome/other platforms teams. Otherwise we'd have to special case this and inspect the effect spec, which would be cumbersome.

Was this page helpful?
0 / 5 - 0 ratings