3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5 <script src="../resources/testcommon.js"></script>
22 div.style.animation = 'anim 100s';
23 var animation = div.getAnimations()[0];
24 assert_equals(animation.effect.target, div,
25 'Animation.target is the animatable div');
26 }, 'Returned CSS animations have the correct effect target');
29 addStyle(t, { '.after::after': 'animation: anim 10s, anim 100s;' });
30 var div = addDiv(t, { class: 'after' });
31 var anims = document.getAnimations();
32 assert_equals(anims.length, 2,
33 'Got animations running on ::after pseudo element');
34 assert_equals(anims[0].effect.target, anims[1].effect.target,
35 'Both animations return the same target object');
36 }, 'effect.target should return the same CSSPseudoElement object each time');
39 addStyle(t, { '.after::after': 'animation: anim 10s;' });
40 var div = addDiv(t, { class: 'after' });
41 var pseudoTarget = document.getAnimations()[0].effect.target;
42 var effect = new KeyframeEffect(pseudoTarget,
43 { background: ["blue", "red"] },
45 var newAnim = new Animation(effect, document.timeline);
47 var anims = document.getAnimations();
48 assert_equals(anims.length, 2,
49 'Got animations running on ::after pseudo element');
50 assert_not_equals(anims[0], newAnim,
51 'The scriped-generated animation appears last');
52 assert_equals(newAnim.effect.target, pseudoTarget,
53 'The effect.target of the scripted-generated animation is ' +
54 'the same as the one from the argument of ' +
55 'KeyframeEffect constructor');
56 assert_equals(anims[0].effect.target, newAnim.effect.target,
57 'Both animations return the same target object');
58 }, 'effect.target from the script-generated animation should return the same ' +
59 'CSSPseudoElement object as that from the CSS generated animation');