Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-animations/crashtests/marquee-element-move-and-toggle-visibility.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="test-wait">
<meta charset="utf-8">
<title>Moving a marquee element and toggling visibility should not crash</title>
<marquee id="target">Don't crash me</marquee>
<div id="container" style="display: none;"></div>
<script>
const target = document.getElementById('target');
const container = document.getElementById('container');
requestAnimationFrame(() => {
requestAnimationFrame(() => {
// Removing the element pauses the animation in Blink.
target.parentElement.removeChild(target);
requestAnimationFrame(() => {
// Reattaching the element resumes the animation regardless of
// visibility.
container.appendChild(target);
requestAnimationFrame(() => {
container.style = "display: block";
document.documentElement.classList.remove('test-wait');
});
});
});
});
</script>
</html>