wpt / svg / animations / svgcolor-animation-invalid-value-1.html

Status: FAIL | Duration: 54ms | Subtests: 0/1 | Open test on wpt.live | wpt.fyi

/svg/animations/svgcolor-animation-invalid-value-1.html

<!doctype html>
<title>
  Test SVGColor animation with invalid value: Invalid color string in from attribute
</title>
<link rel="help" href="https://www.w3.org/TR/2001/REC-smil-animation-20010904/#FromAttribute">
<link rel="help" href="https://www.w3.org/TR/2001/REC-smil-animation-20010904/#ToAttribute">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<svg id="svg">
  <rect id="rect" width="100px" height="100px" fill="green">
    <animate attributeName="fill" from="gr   een" to="red" dur="3s" begin="0s" fill="freeze" />
  </rect>
</svg>

<script>

async_test(t => {
  const svg = document.getElementById("svg");
  const rect = document.getElementById("rect");

  window.addEventListener('load', t.step_func(() => {
    svg.setCurrentTime(2);

      requestAnimationFrame(t.step_func_done(() => {
        assert_equals(rect.getAttribute("fill"), "green");
        assert_equals(window.getComputedStyle(rect).fill, "rgb(0, 128, 0)"); // green
      }));
    }));
  });

</script>