fune/testing/web-platform/tests/css/css-animations/keyframes-remove-documentElement-crash.html
Stephen McGruer 1617ada1f6 Bug 1607240 [wpt PR 21052] - Rework keyframes-remove-documentElement-crash.html to not use testharness.js, a=testonly
Automatic update from web-platform-tests
Rework keyframes-remove-documentElement-crash.html to not use testharness.js (#21052)

Previously this test would fail when loaded locally as the
testharness.js cleanup code would try to access
document.documentElement, which had been removed. Instead, use the
crashtest support
(https://web-platform-tests.org/writing-tests/crashtest.html).

Fixes #20020

--

wpt-commits: 12f1eb104c6b5036f133778113adac50f7bca2bf
wpt-pr: 21052
2020-01-23 11:08:47 +00:00

28 lines
728 B
HTML

<!doctype html>
<html class="test-wait">
<title>CSS Animations Test: Chrome crash when removing documentElement and @keyframes stylesheet</title>
<link rel="help" href="https://crbug.com/999522">
<style>
@keyframes anim {
from { color: pink }
to { color: purple }
}
div {
animation: notfound 1s;
}
</style>
<div></div>
<script>
window.addEventListener('load', () => {
document.body.offsetTop;
document.querySelector("style").remove();
// We need the root later to remove the test-wait class.
const root = document.documentElement;
document.documentElement.remove();
// rAF to make sure that style runs.
requestAnimationFrame(() => {
root.classList.remove('test-wait');
});
});
</script>