dom/smil/test/test_smilCSSFromTo.xhtml

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial