| <!doctype html> |
| <meta charset=utf-8> |
| <title>Accumulation 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 'testAccumulation'. |
| // We use test() function here so that we can continue the remainder tests |
| // even if this test fails. |
| test(t => { |
| assert_own_property(typeObject, 'testAccumulation', animationTypeString + |
| ' should have testAccumulation property'); |
| assert_equals(typeof typeObject.testAccumulation, 'function', |
| 'testAccumulation method should be a function'); |
| }, `${property} (type: ${animationTypeString}) has testAccumulation` |
| + ' function'); |
| |
| if (typeObject.testAccumulation && |
| typeof typeObject.testAccumulation === 'function') { |
| typeObject.testAccumulation(property, |
| setupFunction, |
| animationType.options); |
| } |
| } |
| } |
| }, 'Setup'); |
| </script> |