tor-browser

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

svgpointlist-animation-invalid-value-1.html (1528B)


      1 <!doctype html>
      2 <title>Test SVGPointList animation with invalid values: String value in point list values for from and to attributes.</title>
      3 <link rel="help" href="https://www.w3.org/TR/2001/REC-smil-animation-20010904/#FromAttribute">
      4 <link rel="help" href="https://www.w3.org/TR/2001/REC-smil-animation-20010904/#ToAttribute">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 
      8 <svg id="svg">
      9    <polygon id="poly" points="0,0 200,0 200,200 0,200" fill="green">
     10        <animate attributeName="points" begin="0s" dur="4s" from="0,0 200,0 200,200 A,C" to="0,0 100,0 100,100 0,0" />
     11    </polygon>
     12 </svg>
     13 
     14 <script>
     15 
     16 async_test(t => {
     17    const svg = document.getElementById("svg");
     18    const poly = document.getElementById("poly");
     19 
     20    window.addEventListener('load', t.step_func(() => {
     21        svg.setCurrentTime(2);
     22 
     23        requestAnimationFrame(t.step_func_done(() => {
     24          assert_array_equals(
     25            Array.from(poly.points).map(v => v.x),
     26            [0, 200, 200, 0]
     27          );
     28          assert_array_equals(
     29            Array.from(poly.points).map(v => v.y),
     30            [0, 0, 200, 200]
     31          );
     32 
     33          assert_array_equals(
     34            Array.from(poly.animatedPoints).map(v => v.x),
     35            Array.from(poly.points).map(v => v.x)
     36          );
     37          assert_array_equals(
     38            Array.from(poly.animatedPoints).map(v => v.y),
     39            Array.from(poly.points).map(v => v.y)
     40          );
     41        }));
     42    }));
     43  });
     44 
     45 </script>