| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <script> | |
| 5 'use strict'; | |
| 6 // From UseCounter.h | |
| 7 var WebAnimationsEasingAsFunctionLinear = 1295; | |
| 8 var WebAnimationsEasingAsFunctionOther = 1296; | |
| 9 | |
| 10 test(() => { | |
| 11 document.documentElement.animate([], { }); | |
| 12 document.documentElement.animate([], { easing: 'linear' }); | |
| 13 document.documentElement.animate([], { easing: 'step-start' }); | |
| 14 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLin
ear)); | |
| 15 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOth
er)); | |
| 16 }, 'Non-function values for easing are not use-counted.'); | |
| 17 | |
| 18 test(() => { | |
| 19 assert_throws( | |
| 20 {name: 'TypeError'}, | |
| 21 function() { document.documentElement.animate([], { easing: 'invalid' }) }
); | |
| 22 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLin
ear)); | |
| 23 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOth
er)); | |
| 24 }, 'Invalid non-function values for easing are not use-counted.'); | |
| 25 | |
| 26 test(() => { | |
| 27 // This linear function value is the one expected from uses of the unpatched | |
| 28 // Web Animations polyfill (i.e. old versions lacking | |
| 29 // https://github.com/web-animations/web-animations-next/pull/423). | |
| 30 assert_throws( | |
| 31 {name: 'TypeError'}, | |
| 32 function() { document.documentElement.animate([], { easing: 'function (a){
return a}' }) }); | |
| 33 assert_true(internals.isUseCounted(document, WebAnimationsEasingAsFunctionLine
ar)); | |
| 34 assert_false(internals.isUseCounted(document, WebAnimationsEasingAsFunctionOth
er)); | |
| 35 }, 'A specific linear function for easing is counted in WebAnimationsEasingAsFun
ctionLinear.'); | |
| 36 </script> | |
| OLD | NEW |