tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_smilWithXlink.xhtml (1173B)


      1 <html xmlns="http://www.w3.org/1999/xhtml">
      2 <head>
      3  <title>Test for animate with xlink:href attribute.</title>
      4  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      5  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      6  <style>
      7    div#target {
      8      width: 300px;
      9      height: 100px;
     10      background-color: red;
     11    }
     12  </style>
     13 </head>
     14 <body>
     15 <p id="display"></p>
     16 <div id="target"></div>
     17 <svg xmlns="http://www.w3.org/2000/svg"
     18     xmlns:xlink="http://www.w3.org/1999/xlink"
     19     id="svg">
     20  <animate xlink:href="#target"
     21           attributeName="width" from="0" to="200" dur="10s" fill="freeze"/>
     22 </svg>
     23 <pre id="test">
     24 <script class="testbody" type="text/javascript">
     25 <![CDATA[
     26 SimpleTest.waitForExplicitFinish();
     27 
     28 function runTest() {
     29  var svg = document.getElementById("svg");
     30  var target = document.getElementById("target");
     31 
     32  svg.pauseAnimations();
     33  svg.setCurrentTime(5);
     34 
     35  var cs = getComputedStyle(target);
     36  is(cs.width, "100px", "SMIL should affect outer element.");
     37 
     38  SimpleTest.finish();
     39 }
     40 
     41 window.addEventListener("load", runTest);
     42 
     43 ]]>
     44 </script>
     45 </pre>
     46 </body>
     47 </html>