|
1 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
2 <head> |
|
3 <title>Test for Animation Behavior on CSS Properties</title> |
|
4 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
5 <script type="text/javascript" src="smilTestUtils.js"></script> |
|
6 <script type="text/javascript" src="db_smilCSSPropertyList.js"></script> |
|
7 <script type="text/javascript" src="db_smilCSSFromTo.js"></script> |
|
8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
9 </head> |
|
10 <body> |
|
11 <p id="display"></p> |
|
12 <div id="content"> |
|
13 <svg xmlns="http://www.w3.org/2000/svg" |
|
14 width="200px" height="200px" font-size="50px" style="color: rgb(50,50,50)" |
|
15 onload="this.pauseAnimations()"> |
|
16 <rect x="20" y="20" width="200" height="200"/> |
|
17 <!-- NOTE: hard-wiring 'line-height' so that computed value of 'font' is |
|
18 more predictable. (otherwise, line-height varies depending on platform) |
|
19 --> |
|
20 <text x="20" y="20" style="line-height: 10px !important">testing 123</text> |
|
21 <line/> |
|
22 <image/> |
|
23 <marker/> |
|
24 <clipPath><circle/></clipPath> |
|
25 <filter><feFlood/></filter> |
|
26 <filter><feDiffuseLighting/></filter> |
|
27 <linearGradient><stop/></linearGradient> |
|
28 </svg> |
|
29 </div> |
|
30 <pre id="test"> |
|
31 <script class="testbody" type="text/javascript"> |
|
32 <![CDATA[ |
|
33 |
|
34 SimpleTest.waitForExplicitFinish(); |
|
35 |
|
36 function checkForUntestedProperties(bundleList) |
|
37 { |
|
38 // Create the set of all the properties we know about |
|
39 var propertySet = {}; |
|
40 for (propertyLabel in gPropList) { |
|
41 // insert property |
|
42 propertySet[gPropList[propertyLabel].attrName] = null; |
|
43 } |
|
44 // Remove tested properties from the set |
|
45 for (var bundleIdx in bundleList) { |
|
46 var bundle = bundleList[bundleIdx]; |
|
47 delete propertySet[bundle.animatedAttribute.attrName]; |
|
48 } |
|
49 // Warn about remaining (untested) properties |
|
50 for (var untestedProp in propertySet) { |
|
51 ok(false, "No tests for property '" + untestedProp + "'"); |
|
52 } |
|
53 } |
|
54 |
|
55 function main() |
|
56 { |
|
57 // Start out with document paused |
|
58 var svg = SMILUtil.getSVGRoot(); |
|
59 ok(svg.animationsPaused(), "should be paused by <svg> load handler"); |
|
60 is(svg.getCurrentTime(), 0, "should be paused at 0 in <svg> load handler"); |
|
61 |
|
62 // FIRST: Warn about any properties that are missing tests |
|
63 checkForUntestedProperties(gFromToBundles); |
|
64 |
|
65 // Run the actual tests |
|
66 testBundleList(gFromToBundles, new SMILTimingData(1.0, 1.0)); |
|
67 |
|
68 // Set "display:none" on everything and run the tests again |
|
69 SMILUtil.hideSubtree(SMILUtil.getSVGRoot(), false, false); |
|
70 testBundleList(gFromToBundles, new SMILTimingData(1.0, 1.0)); |
|
71 |
|
72 SimpleTest.finish(); |
|
73 } |
|
74 |
|
75 window.addEventListener("load", main, false); |
|
76 ]]> |
|
77 </script> |
|
78 </pre> |
|
79 </body> |
|
80 </html> |