Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/animations/animate-display-to-none-001.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset="utf-8">
<title>Test that underlying style gets restored when seeking away from the
'to' portion of a SVG/SMIL animation to 'display:none'</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<link rel="match" href="../struct/reftests/reference/green-100x100.html">
<script>
function go() {
svgElem.pauseAnimations();
/* Seek to 75% of the way through duration, when the animation should be
* imposing the "to" value. (This is necessary to trigger the bug
* that we're regression-testing for here.) */
svgElem.setCurrentTime(3);
/* Now, seek back to 25% of the way through duration, when the underlying
* value should be restored. This should make the green rect show up
* in our reftest screenshot. */
svgElem.setCurrentTime(1);
}
</script>
<body onload="go()">
<svg id="svgElem">
<rect width="100" height="100" fill="red"/>
<rect width="100" height="100" fill="green">
<animate attributeName="display" to="none"
begin="0s" dur="4s"/>
</rect>
</svg>