OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <title>SVGLengthList, appendItem() from cleared list</title> | 2 <title>SVGLengthList, appendItem() from cleared list</title> |
3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script src="resources/SVGLengthList-helper.js"></script> |
5 <svg width="200" height="200"> | 6 <svg width="200" height="200"> |
6 <text id="text1" x="1 2 3">ABC</text> | 7 <text id="text1" x="1 2 3">ABC</text> |
7 <text id="text2" x="10 20">ABC</text> | 8 <text id="text2" x="10 20">ABC</text> |
8 </svg> | 9 </svg> |
9 <script> | 10 <script> |
10 test(function() { | 11 test(function() { |
11 // This is a test of the SVGLengthList::appendItem() API. | 12 // This is a test of the SVGLengthList::appendItem() API. |
12 | 13 |
13 var list1 = document.getElementById("text1").x.baseVal; | 14 var list1 = document.getElementById("text1").x.baseVal; |
14 var list2 = document.getElementById("text2").x.baseVal; | 15 var list2 = document.getElementById("text2").x.baseVal; |
15 | 16 |
16 var itemFromClearedList = list2.getItem(0); | 17 var itemFromClearedList = list2.getItem(0); |
17 list2.clear(); | 18 list2.clear(); |
18 assert_equals(list2.numberOfItems, 0); | 19 assert_equals(list2.numberOfItems, 0); |
19 | 20 |
20 list1.appendItem(itemFromClearedList); | 21 list1.appendItem(itemFromClearedList); |
21 | 22 |
22 assert_equals(list1.numberOfItems, 4); | 23 assert_list(list1, [1, 2, 3, 10]); |
23 assert_equals(list1.getItem(0).value, 1); | |
24 assert_equals(list1.getItem(1).value, 2); | |
25 assert_equals(list1.getItem(2).value, 3); | |
26 assert_equals(list1.getItem(3).value, 10); | |
27 | |
28 assert_equals(list2.numberOfItems, 0); | 24 assert_equals(list2.numberOfItems, 0); |
29 }); | 25 }); |
30 </script> | 26 </script> |
OLD | NEW |