tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

img-invalidation-local-transform-1.html (1205B)


      1 <!DOCTYPE HTML>
      2 <html class="reftest-wait">
      3 <!-- test for bug 1469000 https://bugzilla.mozilla.org/show_bug.cgi?id=1469000 -->
      4 <!-- this based on image/*/delaytest.html tests -->
      5 <head>
      6 <style>
      7  img {
      8    max-width: 100%;
      9    height: auto;
     10  }
     11 </style>
     12 </head>
     13 <body>
     14 <div style="width: 450px">
     15 <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">
     16 </div>
     17 
     18 
     19 <script>
     20 window.addEventListener("load", forceDecode);
     21 window.addEventListener("MozReftestInvalidate", reftestInvalidateListener);
     22 
     23 let decodeComplete = false;
     24 let gotReftestInvalidate = false;
     25 
     26 function forceDecode() {
     27  let img = document.getElementById("image1");
     28  img.decode().then(function() {
     29    decodeComplete = true;
     30    maybeStartTimer();
     31  });
     32 }
     33 
     34 function reftestInvalidateListener() {
     35  gotReftestInvalidate = true;
     36  maybeStartTimer();
     37 }
     38 
     39 function maybeStartTimer() {
     40  if (decodeComplete && gotReftestInvalidate) {
     41    startTimer();
     42  }
     43 }
     44 
     45 function startTimer() {
     46  const delay = 2000;
     47  setTimeout("document.documentElement.className = '';", delay);
     48 }
     49 </script>
     50 </body>
     51 </html>