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-from-by-animation-both-empty.tentative.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>SVG path 'd' from-by animation with both values empty</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 40 40 L 60 40 L 60 60 L 40 60 Z">
<animate id="animation" attributeName="d"
from="" by=""
begin="0s" dur="4s" fill="freeze"/>
</path>
</svg>
<script>
const rootSVGElement = document.querySelector("svg");
// from-by with both empty: 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>