Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /svg/animations/animate-path-additive-sum-both-empty-over-base.tentative.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>SVG path 'd' additive animation with both-empty over non-empty base</title>
<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 10 10 L 90 10 L 90 90 L 10 90 Z">
<animate id="animation" attributeName="d"
from="" to="" additive="sum"
begin="0s" dur="4s" fill="freeze"/>
</path>
</svg>
<script>
const rootSVGElement = document.querySelector("svg");
// Additive animation where both from and to are empty. The empty result cannot
// be added to the non-empty base, so the animation fails and the base value is
// preserved throughout.
function sample1() {
assert_animated_path_equals(path, "M 10 10 L 90 10 L 90 90 L 10 90 Z");
}
smil_async_test((t) => {
const expectedValues = [
["animation", 0.001, sample1],
["animation", 2.0, sample1],
["animation", 3.999, sample1],
];
runAnimationTest(t, expectedValues);
});
</script>