Bug 1792334 - Decom nsIXPConnect and friends. r=mccr8
[gecko.git] / image / test / crashtests / 1634839-2.html
blobd3629421fb2ef9fc211a6bbd458de71c874e7120
1 <!DOCTYPE HTML>
2 <html class="reftest-wait">
3 <head>
4 </head>
5 <body>
6 <div id="container">
7 <iframe id='if' src="1634839-2-iframe.html"></iframe>
8 </div>
10 <script>
11 let iterationsLeft = 1;
13 let img = null;
15 function runTest() {
16 // Make sure the image is decoded and advanced to it's final frame.
17 img = document.getElementById("if").contentWindow.document.getElementById("image1");
18 img.decode().then(function() {
19 setTimeout(forceDiscard, 1000);
20 });
23 function showIframe() {
24 document.getElementById("container").style.display = "";
25 document.documentElement.getBoundingClientRect();
26 requestAnimationFrame(forceDecode);
29 function forceDecode() {
30 img.decode().then(function() {
31 setTimeout(forceDiscard, 0);
32 });
35 function forceDiscard() {
36 iterationsLeft--;
37 if (iterationsLeft < 0) {
38 document.documentElement.className = "";
39 return;
41 document.getElementById("container").style.display = "none";
42 document.documentElement.getBoundingClientRect();
43 img.remove();
44 requestAnimationFrame(() => { requestAnimationFrame( () => { setTimeout(showIframe, 0); } ) });
47 //window.addEventListener("load", runTest);
48 window.addEventListener("MozReftestInvalidate", runTest);
49 </script>
50 </body>
51 </html>