OLD | NEW |
| 1 <!DOCTYPE html> |
| 2 <title>EventHandlers on SVGAnimationElement test</title> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script> |
1 function getObject(interface) { | 6 function getObject(interface) { |
2 switch(interface) { | 7 switch(interface) { |
3 case "SVGAnimateElement": | 8 case "SVGAnimateElement": |
4 var e = document.createElementNS("http://www.w3.org/2000/svg", "anim
ate"); | 9 var e = document.createElementNS("http://www.w3.org/2000/svg", "anim
ate"); |
5 assert_true(e instanceof SVGAnimateElement); | 10 assert_true(e instanceof SVGAnimateElement); |
6 return e; | 11 return e; |
7 case "SVGAnimateMotionElement": | 12 case "SVGAnimateMotionElement": |
8 var e = document.createElementNS("http://www.w3.org/2000/svg", "anim
ateMotion"); | 13 var e = document.createElementNS("http://www.w3.org/2000/svg", "anim
ateMotion"); |
9 assert_true(e instanceof SVGAnimateMotionElement); | 14 assert_true(e instanceof SVGAnimateMotionElement); |
10 return e; | 15 return e; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 69 } |
65 var enumerableCache = {}; | 70 var enumerableCache = {}; |
66 function testEnumerate(interface, attribute) { | 71 function testEnumerate(interface, attribute) { |
67 if (!(interface in enumerableCache)) { | 72 if (!(interface in enumerableCache)) { |
68 enumerableCache[interface] = getEnumerable(interface); | 73 enumerableCache[interface] = getEnumerable(interface); |
69 } | 74 } |
70 test(function() { | 75 test(function() { |
71 assert_true(enumerableCache[interface][attribute]); | 76 assert_true(enumerableCache[interface][attribute]); |
72 }, "Enumerate " + interface + "." + attribute); | 77 }, "Enumerate " + interface + "." + attribute); |
73 } | 78 } |
| 79 |
| 80 var attributeToEventMap = { |
| 81 "onbegin" : "beginEvent", |
| 82 "onend" : "endEvent", |
| 83 "onrepeat" : "repeatEvent" |
| 84 }; |
| 85 |
| 86 for (var attribute in attributeToEventMap) { |
| 87 [ |
| 88 "SVGAnimateElement", |
| 89 "SVGAnimateMotionElement", |
| 90 "SVGAnimateTransformElement", |
| 91 "SVGSetElement" |
| 92 ].forEach(function(interface) { |
| 93 testSet(interface, attribute); |
| 94 testEnumerate(interface, attribute); |
| 95 testReflect(interface, attribute); |
| 96 }); |
| 97 |
| 98 testEventHandlerMapping(attribute, attributeToEventMap[attribute]); |
| 99 } |
| 100 </script> |
OLD | NEW |