Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/animations/svgcolor-animation-invalid-value-1.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>
Test SVGColor animation with invalid value: Invalid color string in from attribute
</title>
<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>