tor-browser

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

2d.layer.reset.plain_layer.html (1106B)


      1 <!DOCTYPE html>
      2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
      3 <meta charset="UTF-8">
      4 <link rel="match" href="2d.layer.reset.plain_layer-expected.html">
      5 <title>Canvas test: 2d.layer.reset.plain_layer</title>
      6 <h1>2d.layer.reset.plain_layer</h1>
      7 <p class="desc">Checks that reset discards any pending layers.</p>
      8 <canvas id="canvas" width="100" height="50">
      9  <p class="fallback">FAIL (fallback content)</p>
     10 </canvas>
     11 <script>
     12  const canvas = document.getElementById("canvas");
     13  const ctx = canvas.getContext('2d');
     14 
     15  // Global states:
     16  ctx.globalAlpha = 0.3;
     17  ctx.globalCompositeOperation = 'source-in';
     18  ctx.shadowOffsetX = -3;
     19  ctx.shadowOffsetY = 3;
     20  ctx.shadowColor = 'rgba(0, 30, 0, 0.3)';
     21  ctx.shadowBlur = 3;
     22  ctx.filter = 'blur(5px)';
     23 
     24  ctx.beginLayer();
     25 
     26  // Layer states:
     27  ctx.globalAlpha = 0.6;
     28  ctx.globalCompositeOperation = 'source-in';
     29  ctx.shadowOffsetX = -6;
     30  ctx.shadowOffsetY = 6;
     31  ctx.shadowColor = 'rgba(0, 60, 0, 0.6)';
     32  ctx.shadowBlur = 3;
     33  ctx.filter = 'blur(15px)';
     34 
     35  ctx.reset();
     36 
     37  ctx.fillRect(10, 10, 75, 50);
     38 </script>