dom/smil/test/test_smilMappedAttrFromTo.xhtml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial