web-animations / web-animations-js

JavaScript implementation of the Web Animations API
http://web-animations.github.io
Apache License 2.0
3.77k stars 408 forks source link

Feature Detection For browsers with partial support #196

Open lannonbr opened 6 years ago

lannonbr commented 6 years ago

It is fairly easy to dynamically load in the polyfill if a browser doesn't support the Web Animations API at all by the following:

if(!('animate' in document.body)) {
  // load in polyfill
}

Although, the current stable version of safari doesn't fully support the AnimationEffectTimingProperties even under the expirimental support under a flag. What is a suggestion to detect if the browser doesn't have full support of the Web Animations API to load in only if needed.

geosigno commented 4 years ago

any idea on this one?

birtles commented 4 years ago

I don't think Safari ever shipped to release a version that didn't support AnimaitonEffectTimingProperties (without flipping a flag) so I don't think feature detection for this particular subset is necessary?

kwasimensah commented 4 years ago

I'm running into this this also (setting Animation.currentTime doesn't work on Safari as documented at https://developer.mozilla.org/en-US/docs/Web/API/Animation/currentTime) and would like a way to force Safari to use this library's animation implementation.