wpt / svg / animations / animate-path-from-by-animation-empty-by.tentative.html

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

/svg/animations/animate-path-from-by-animation-empty-by.tentative.html

<!doctype html>
<title>SVG path 'd' from-by animation with empty 'by' value</title>
<link rel="help" href="https://svgwg.org/svg2-draft/paths.html#TheDProperty"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/SVGAnimationTestCase-testharness.js"></script>
<script src="support/animated-path-helpers.js"></script>
<svg>
  <path id="path" fill="green" d="M 40 40 L 60 40 L 60 60 L 40 60 Z">
    <animate id="animation" attributeName="d"
             from="M 10 10 L 90 10 L 90 90 L 10 90 Z" by=""
             begin="0s" dur="4s" fill="freeze"/>
  </path>
</svg>
<script>
const rootSVGElement = document.querySelector("svg");

// from-by with empty by: the empty by value cannot be added to the from
// value, so the animation is invalid. The base value is preserved throughout.
function sample1() {
  assert_animated_path_equals(path, "M 40 40 L 60 40 L 60 60 L 40 60 Z");
}

smil_async_test((t) => {
  const expectedValues = [
    ["animation", 0.001, sample1],
    ["animation", 2.0,   sample1],
    ["animation", 3.999, sample1],
  ];
  runAnimationTest(t, expectedValues);
});
</script>