2 <script src=
"../../../resources/testharness.js"></script>
3 <script src=
"../../../resources/testharnessreport.js"></script>
5 <div id=
"parent"></div>
8 function assertComposited(properties
, isComposited
) {
9 var element
= document
.createElement('div');
10 document
.getElementById('parent').appendChild(element
);
12 var properties
= typeof properties
== "string" ? [properties
] : properties
;
15 properties
.forEach(function(property
) {
16 keyframe
[property
] = 'initial';
19 var animation
= element
.animate([keyframe
, keyframe
], {
24 var asyncHandle
= async_test("Animation on " + properties
.join(", ") + (isComposited
? " is " : " is not ") + "composited");
25 requestAnimationFrame(function() {
26 requestAnimationFrame(function() {
27 asyncHandle
.step(function() {
28 assert_equals(internals
.isCompositedAnimation(animation
), isComposited
, properties
.join(", ") + (isComposited
? " should " : " should not ") + "be composited");
37 var assertIsComposited = function(properties
) { return assertComposited(properties
, true); }
38 var assertIsNotComposited = function(properties
) { return assertComposited(properties
, false); }
40 assertIsComposited('transform');
41 assertIsComposited('opacity');
43 assertIsComposited('translate');
44 assertIsComposited('rotate');
45 assertIsComposited('scale');
47 assertIsComposited(['transform', 'opacity']);
48 assertIsComposited(['translate', 'opacity']);
49 assertIsComposited(['rotate', 'opacity']);
50 assertIsComposited(['scale', 'opacity']);
52 assertIsNotComposited(['transform', 'translate']);
53 assertIsNotComposited(['transform', 'scale']);
54 assertIsNotComposited(['transform', 'rotate']);
56 assertIsNotComposited(['translate', 'scale']);
57 assertIsNotComposited(['translate', 'rotate']);
58 assertIsNotComposited(['rotate', 'scale']);
60 assertIsNotComposited(['translate', 'rotate', 'scale']);
61 assertIsNotComposited(['transform', 'translate', 'rotate', 'scale']);