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

     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[
    34 SimpleTest.waitForExplicitFinish();
    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 }
    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");
    62   // FIRST: Warn about any properties that are missing tests
    63   checkForUntestedProperties(gFromToBundles);
    65   // Run the actual tests
    66   testBundleList(gFromToBundles, new SMILTimingData(1.0, 1.0));
    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));
    72   SimpleTest.finish();
    73 }
    75 window.addEventListener("load", main, false);
    76 ]]>
    77 </script>
    78 </pre>
    79 </body>
    80 </html>

mercurial