OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <meta charset=utf-8> | |
3 <title>AnimationNode parent attribute tests</title> | |
4 <meta name="assert" content="The parent animation group of this animation node o
r null if this animation node does not have a parent animation group"> | |
5 <link rel="help" href="http://w3c.github.io/web-animations/#dom-animationnode-pa
rent"> | |
6 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru"> | |
7 <link rel="author" title="Aleksei Yu. Semenov" href="mailto:a.semenov@unipro.ru"
> | |
8 <script src="../../../../resources/testharness.js"></script> | |
9 <script src="../../../../resources/testharnessreport.js"></script> | |
10 <script src="../testcommon.js"></script> | |
11 <body> | |
12 <div id="log"></div> | |
13 <script> | |
14 test(function() { | |
15 var nodes = [newAnimation(createDiv(this)), new AnimationGroup([]), new Anim
ationSequence([])]; | |
16 nodes.forEach(function(node) { | |
17 assert_equals(node.parent, null, type(node) + '.parent should be null'); | |
18 }); | |
19 }, 'AnimationNode.parent is null if animation node does not have a parent animat
ion group'); | |
20 | |
21 test(function() { | |
22 var test = this; | |
23 var parents = [AnimationGroup, AnimationSequence]; | |
24 parents.forEach(function(parentCtor) { | |
25 var nodes = [newAnimation(createDiv(test)), new AnimationGroup([]), new
AnimationSequence([])]; | |
26 nodes.forEach(function(node) { | |
27 var parent = new parentCtor([node]); | |
28 | |
29 assert_equals(node.parent, parent, type(node) + '.parent should retu
rn ' + | |
30 'parent animation group of this animation node'); | |
31 }); | |
32 }); | |
33 }, 'AnimationNode.parent returns parent animation group of this animation node')
; | |
34 | |
35 test(function() { | |
36 var test = this; | |
37 var parents = [AnimationGroup, AnimationSequence]; | |
38 parents.forEach(function(parentCtor) { | |
39 var nodes = [newAnimation(createDiv(test)), new AnimationGroup([]), new
AnimationSequence([])]; | |
40 var parent = new parentCtor([nodes[0], nodes[1], nodes[2]]); | |
41 nodes.forEach(function(node) { | |
42 assert_equals(node.parent, parent, type(node) + '.parent should retu
rn ' + | |
43 'parent animation group of this animation node'); | |
44 }); | |
45 }); | |
46 }, 'AnimationNode.parent returns parent animation group of this animation node.
' + | |
47 'The group has several children nodes'); | |
48 | |
49 // The rest is tested in mutator methods: AnimationNode.before(), AnimationNode.
after(), | |
50 // AnimationNode.replace(), AnimationNode.remove(), | |
51 // AnimationGroup.prepend(), AnimationGroup.append(), AnimationGroup.clone() | |
52 </script> | |
53 </body> | |
OLD | NEW |