Files
ladybird/Tests/LibWeb/Crash/wpt-import/editing/crashtests/designMode-caret-change.html
Jelle Raaijmakers 0cd1d4f08e Tests/LibWeb: Import WPT designMode-caret-change.html crash test
With both the onanimation* handlers and the designMode fixes in place,
this crash test no longer times out.
2026-01-13 10:09:22 +01:00

38 lines
868 B
HTML

<!doctype html>
<html class="test-wait">
<style>
button {
background-repeat: no-repeat;
}
*:last-child {
opacity: 0;
animation: kf ease-in, steps(65, start) 0.92 paused;
border-radius: inherit
}
@keyframes kf {}
</style>
<script>
let animationEnded = false;
let selectionChanged = false;
function maybeFinishTest() {
if (animationEnded && selectionChanged) {
requestAnimationFrame(() => requestAnimationFrame(() => {
document.documentElement.className = "";
}));
}
}
document.addEventListener("DOMContentLoaded", () => {
document.designMode = "on"
window.onanimationend = () => {
document.execCommand("insertHTML", false, "A")
animationEnded = true;
maybeFinishTest();
}
document.onselectionchange = () => {
document.execCommand("selectAll", false)
selectionChanged = true;
maybeFinishTest();
}
})
</script>