diff --git a/core/src/components/nav/test/nav-controller.spec.ts b/core/src/components/nav/test/nav-controller.spec.ts index 695e980620..168f1a0e29 100644 --- a/core/src/components/nav/test/nav-controller.spec.ts +++ b/core/src/components/nav/test/nav-controller.spec.ts @@ -926,7 +926,7 @@ describe('NavController', () => { const MockView5 = 'mock-view5'; const mockWebAnimation = (el: HTMLElement) => { - window.Animation = () => {}; + Element.prototype.animate = () => {}; el.animate = () => { const animation = { diff --git a/core/src/utils/animation/animation.ts b/core/src/utils/animation/animation.ts index b7a769a8da..31c3f579eb 100644 --- a/core/src/utils/animation/animation.ts +++ b/core/src/utils/animation/animation.ts @@ -42,7 +42,7 @@ export const createAnimation = () => { const _afterAddReadFunctions: any[] = []; const _afterAddWriteFunctions: any[] = []; const webAnimations: any[] = []; - const supportsWebAnimations = (typeof (window as any).Animation === 'function'); + const supportsWebAnimations = (typeof (Element as any) === 'function') && (typeof (Element as any).prototype!.animate === 'function'); const ANIMATION_END_FALLBACK_PADDING_MS = 100; /** diff --git a/core/src/utils/animation/test/animationbuilder/index.html b/core/src/utils/animation/test/animationbuilder/index.html index 4bf70132c6..6d01be6019 100644 --- a/core/src/utils/animation/test/animationbuilder/index.html +++ b/core/src/utils/animation/test/animationbuilder/index.html @@ -12,7 +12,7 @@ -