Skip to content
Permalink
Browse files

fix(animation): better feature detection (#19212)

fixes #19205
  • Loading branch information...
liamdebeasi committed Aug 28, 2019
1 parent 93f2064 commit 6eca5b0d7fde1ef0f3180fa739f685c5dcde7473
@@ -926,7 +926,7 @@ describe('NavController', () => {
const MockView5 = 'mock-view5';

const mockWebAnimation = (el: HTMLElement) => {
window.Animation = () => {};
Element.prototype.animate = () => {};

el.animate = () => {
const animation = {
@@ -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;

/**
@@ -12,7 +12,7 @@
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> <script>
const forceCSSAnimations = new URLSearchParams(window.location.search).get('ionic:_forceCSSAnimations');
if (forceCSSAnimations) {
window.Animation = null;
Element.prototype.animate = null;
}
class PageRoot extends HTMLElement {
@@ -14,7 +14,7 @@
<script type="module">
const forceCSSAnimations = new URLSearchParams(window.location.search).get('ionic:_forceCSSAnimations');
if (forceCSSAnimations) {
window.Animation = null;
Element.prototype.animate = null;
}
import { createAnimation } from '../../../../dist/index.mjs';
@@ -14,7 +14,7 @@
<script type="module">
const forceCSSAnimations = new URLSearchParams(window.location.search).get('ionic:_forceCSSAnimations');
if (forceCSSAnimations) {
window.Animation = null;
Element.prototype.animate = null;
}
import { createAnimation } from '../../../../dist/index.mjs';
@@ -14,7 +14,7 @@
<script type="module">
const forceCSSAnimations = new URLSearchParams(window.location.search).get('ionic:_forceCSSAnimations');
if (forceCSSAnimations) {
window.Animation = null;
Element.prototype.animate = null;
}
import { createAnimation } from '../../../../dist/index.mjs';
@@ -14,7 +14,7 @@
<script type="module">
const forceCSSAnimations = new URLSearchParams(window.location.search).get('ionic:_forceCSSAnimations');
if (forceCSSAnimations) {
window.Animation = null;
Element.prototype.animate = null;
}
import { createAnimation } from '../../../../dist/index.mjs';
@@ -11,9 +11,12 @@
<script src="../../../../../scripts/testing/scripts.js"></script>
<script nomodule src="../../../../../dist/ionic/ionic.js"></script>
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
<script type="module">
window.Animation = null;
<script type="module">
const forceCSSAnimations = new URLSearchParams(window.location.search).get('ionic:_forceCSSAnimations');
if (forceCSSAnimations) {
Element.prototype.animate = null;
}
import { createAnimation } from '../../../../dist/index.mjs';
createAnimation()

0 comments on commit 6eca5b0

Please sign in to comment.
You can’t perform that action at this time.