tor-browser

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

canvas-outside-document-invalidate-01.html (738B)


      1 <!--
      2     Any copyright is dedicated to the Public Domain.
      3     http://creativecommons.org/licenses/publicdomain/
      4 
      5     Test that painting in an out-of-document canvas causes a repaint.
      6 -->
      7 <!DOCTYPE html>
      8 <html class="reftest-wait">
      9 <body style="background: -moz-element(#e) darkred">
     10 
     11 <script>
     12 
     13 var canvas = document.createElement("canvas");
     14 canvas.width = canvas.height = 1;
     15 var ctx = canvas.getContext('2d');
     16 ctx.fillStyle = "red";
     17 ctx.fillRect(0, 0, 1, 1);
     18 window.addEventListener("MozReftestInvalidate", function () {
     19  setTimeout(function () {
     20    ctx.fillStyle = "white";
     21    ctx.fillRect(0, 0, 1, 1);
     22    document.documentElement.className = "";
     23  }, 0);
     24 });
     25 
     26 document.mozSetImageElement("e", canvas);
     27 
     28 </script>
     29 </body>
     30 </html>