OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <title>SVGAnimatedAngle interface - utilizing the orientAngle property of SVGMar
kerElement</title> |
3 <head> | 3 <script src="../../resources/testharness.js"></script> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 </head> | 5 <script> |
6 <body> | 6 test(function() { |
7 <p id="description"></p> | 7 // This test checks the SVGAnimatedAngle API - utilizing the orientAngle prope
rty of SVGMarkerElement. |
8 <div id="console"></div> | 8 |
9 <script src="script-tests/SVGAnimatedAngle.js"></script> | 9 var markerElement = document.createElementNS("http://www.w3.org/2000/svg", "ma
rker"); |
10 </body> | 10 |
11 </html> | 11 // Check initial orientAngle value. |
| 12 assert_true(markerElement.orientAngle instanceof SVGAnimatedAngle); |
| 13 assert_true(markerElement.orientAngle.baseVal instanceof SVGAngle); |
| 14 assert_equals(markerElement.orientAngle.baseVal.value, 0); |
| 15 |
| 16 // Check that angles are dynamic, caching value in a local variable and modify
ing it, should take effect. |
| 17 var numRef = markerElement.orientAngle.baseVal; |
| 18 numRef.value = 100; |
| 19 assert_equals(numRef.value, 100); |
| 20 assert_equals(markerElement.orientAngle.baseVal.value, 100); |
| 21 |
| 22 // Check that assigning to baseVal has no effect, as no setter is defined. |
| 23 markerElement.orientAngle.baseVal = -1; |
| 24 assert_equals(markerElement.orientAngle.baseVal.value, 100); |
| 25 markerElement.orientAngle.baseVal = 'aString'; |
| 26 assert_equals(markerElement.orientAngle.baseVal.value, 100); |
| 27 markerElement.orientAngle.baseVal = markerElement; |
| 28 assert_equals(markerElement.orientAngle.baseVal.value, 100); |
| 29 |
| 30 // Check that the orientAngle baseVal type has not been changed. |
| 31 assert_true(markerElement.orientAngle.baseVal instanceof SVGAngle); |
| 32 }); |
| 33 </script> |
OLD | NEW |