| <!DOCTYPE html> |
| <meta charset=utf-8> |
| <title>Interpolation for each property</title> |
| <link rel="help" href="https://drafts.csswg.org/web-animations/#animation-types"> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script src="../../testcommon.js"></script> |
| <script src="property-list.js"></script> |
| <script src="property-types.js"></script> |
| <style> |
| html { |
| font-size: 10px; |
| } |
| </style> |
| <body> |
| <div id="log"></div> |
| <script> |
| 'use strict'; |
| |
| test(function() { |
| for (const property in gCSSProperties) { |
| if (!isSupported(property)) { |
| continue; |
| } |
| |
| const setupFunction = gCSSProperties[property].setup; |
| for (const animationType of gCSSProperties[property].types) { |
| let typeObject; |
| let animationTypeString; |
| if (typeof animationType === 'string') { |
| typeObject = types[animationType]; |
| animationTypeString = animationType; |
| } else if (typeof animationType === 'object' && |
| animationType.type && typeof animationType.type === 'string') { |
| typeObject = types[animationType.type]; |
| animationTypeString = animationType.type; |
| } |
| |
| // First, test that the animation type object has 'testInterpolation'. |
| // We use test() function() here so that we can continue the remainder tests |
| // even if this test fails. |
| test(t => { |
| assert_own_property(typeObject, 'testInterpolation', animationTypeString + |
| ' should have testInterpolation property'); |
| assert_equals(typeof typeObject.testInterpolation, 'function', |
| 'testInterpolation method should be a function'); |
| }, `${property} (type: ${animationTypeString}) has testInterpolation` |
| + ' function'); |
| |
| if (typeObject.testInterpolation && |
| typeof typeObject.testInterpolation === 'function') { |
| typeObject.testInterpolation(property, |
| setupFunction, |
| animationType.options); |
| } |
| } |
| } |
| }, 'Setup'); |
| </script> |