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