Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE HTML>
<html class="reftest-wait">
<!-- this based on image/*/delaytest.html tests -->
<head>
<style>
img {
max-width: 100%;
height: auto;
}
</style>
</head>
<body>
<div style="width: 450px">
<img id="image1" src="img-invalidation-local-transform-1.png" srcset="img-invalidation-local-transform-1.png 400w, img-invalidation-local-transform-1.png 217w, img-invalidation-local-transform-1.png 100w">
</div>
<script>
window.addEventListener("load", forceDecode);
window.addEventListener("MozReftestInvalidate", reftestInvalidateListener);
let decodeComplete = false;
let gotReftestInvalidate = false;
function forceDecode() {
let img = document.getElementById("image1");
img.decode().then(function() {
decodeComplete = true;
maybeStartTimer();
});
}
function reftestInvalidateListener() {
gotReftestInvalidate = true;
maybeStartTimer();
}
function maybeStartTimer() {
if (decodeComplete && gotReftestInvalidate) {
startTimer();
}
}
function startTimer() {
const delay = 2000;
setTimeout("document.documentElement.className = '';", delay);
}
</script>
</body>
</html>