tor-browser

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

unclosed-nested-layers.html (1142B)


      1 <!DOCTYPE html>
      2 <html class="reftest-wait">
      3 <link rel="match" href="unclosed-nested-layers-expected.html">
      4 <title>Canvas test: unclosed-nested-layers</title>
      5 <h1>unclosed-nested-layers</h1>
      6 <p class="desc">Check that unclosed nested layers aren't rendered.</p>
      7 <canvas id="canvas" width="1" height="1">
      8  <p class="fallback">FAIL (fallback content)</p>
      9 </canvas>
     10 <script>
     11  var placeholder = document.getElementById('canvas');
     12  var offscreen = placeholder.transferControlToOffscreen();
     13  const ctx = offscreen.getContext('2d');
     14  offscreen.width = offscreen.height = 200;
     15 
     16  ctx.fillStyle = 'rgba(0, 0, 255, 1)';
     17  ctx.fillRect(60, 60, 75, 50);
     18 
     19  ctx.beginLayer();
     20  ctx.fillStyle = 'rgba(225, 0, 0, 1)';
     21  ctx.fillRect(50, 50, 75, 50);
     22 
     23  ctx.beginLayer();
     24  ctx.fillStyle = 'rgba(0, 255, 0, 1)';
     25  ctx.fillRect(70, 70, 75, 50);
     26 
     27  ctx.endLayer();
     28  // Missing ctx.endLayer() here.
     29 
     30  function draw () {
     31    // Wait until frame propagates.
     32    if(placeholder.width != 200) {
     33      requestAnimationFrame(draw);
     34    } else {
     35      document.documentElement.classList.remove("reftest-wait");
     36    }
     37  }
     38  requestAnimationFrame(draw);
     39 </script>