tor-browser

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

2d.layer.flush-on-frame-presentation.plain_layer.html (1254B)


      1 <!DOCTYPE html>
      2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
      3 <meta charset="UTF-8">
      4 <html class="reftest-wait">
      5 <link rel="match" href="2d.layer.flush-on-frame-presentation.plain_layer-expected.html">
      6 <title>Canvas test: 2d.layer.flush-on-frame-presentation.plain_layer</title>
      7 <h1>2d.layer.flush-on-frame-presentation.plain_layer</h1>
      8 <p class="desc">Check that layers state stack is flushed and rebuilt on frame renders.</p>
      9 <canvas id="canvas" width="200" height="200">
     10  <p class="fallback">FAIL (fallback content)</p>
     11 </canvas>
     12 <script type="module">
     13  const canvas = document.getElementById("canvas");
     14  const ctx = canvas.getContext('2d');
     15 
     16  ctx.fillStyle = 'purple';
     17  ctx.fillRect(60, 60, 75, 50);
     18  ctx.globalAlpha = 0.5;
     19  ctx.filter = 'blur(1px)';
     20 
     21  ctx.beginLayer();
     22  ctx.fillRect(40, 40, 75, 50);
     23  ctx.fillStyle = 'grey';
     24  ctx.fillRect(50, 50, 75, 50);
     25 
     26  // Force a flush and restoration of the state stack:
     27  await new Promise(resolve => requestAnimationFrame(resolve));
     28 
     29  ctx.fillRect(70, 70, 75, 50);
     30  ctx.fillStyle = 'orange';
     31  ctx.fillRect(80, 80, 75, 50);
     32  ctx.endLayer();
     33 
     34  ctx.fillRect(80, 40, 75, 50);
     35  document.documentElement.classList.remove("reftest-wait");
     36 </script>
     37 </html>