tor-browser

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

canvas.2d.offscreen.worker.lang-ref.html (1433B)


      1 <!doctype HTML>
      2 <html class="reftest-wait">
      3  <meta charset="utf-8">
      4  <title>HTML5 Canvas Test Reference: The lang attribute in an offscreen worker</title>
      5  <link rel="author" href="mailto:schenney@chromium.org"/>
      6  <script src="/common/reftest-wait.js"></script>
      7  <style>
      8    #canvas-en {
      9      position: absolute;
     10      top: 10px;
     11      left: 10px;
     12    }
     13    #canvas-tr {
     14      position: absolute;
     15      top: 120px;
     16      left: 10px;
     17    }
     18  </style>
     19  <script>
     20    function drawText(language) {
     21      var canvas = document.getElementById('canvas-' + language);
     22      var ctx = canvas.getContext('2d');
     23 
     24      ctx.font = '25px Lato-Medium';
     25      ctx.fillText('fi', 5, 50);
     26 
     27      ctx.fillStyle = '#0f0';
     28      ctx.fillRect(0, 0, 1, 1);
     29    }
     30    function generateReference() {
     31      let test_font = new FontFace(
     32        // Lato-Medium is a font with language specific ligatures.
     33        "Lato-Medium",
     34        "url(/fonts/Lato-Medium.ttf)"
     35      );
     36 
     37      test_font.load().then((font) => {
     38        document.fonts.add(font);
     39        drawText('tr');
     40        drawText('en');
     41        takeScreenshot();
     42      });
     43    }
     44  </script>
     45  <body onload="generateReference()">
     46    <canvas lang="en" id="canvas-tr" width="300" height="100">
     47      Browser does not support HTML5 Canvas.
     48    </canvas>
     49    <canvas lang="tr" id="canvas-en" width="300" height="100">
     50      Browser does not support HTML5 Canvas.
     51    </canvas>
     52  </body>
     53 </html>