tor-browser

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

2d.text.draw.space.collapse.nonspace.html (1097B)


      1 <!DOCTYPE html>
      2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
      3 <meta charset="UTF-8">
      4 <title>OffscreenCanvas test: 2d.text.draw.space.collapse.nonspace</title>
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/html/canvas/resources/canvas-tests.js"></script>
      8 
      9 <h1>2d.text.draw.space.collapse.nonspace</h1>
     10 <p class="desc">Non-space characters are not converted to U+0020 and collapsed</p>
     11 
     12 
     13 <script>
     14 promise_test(async t => {
     15 
     16  var canvas = new OffscreenCanvas(100, 50);
     17  var ctx = canvas.getContext('2d');
     18 
     19  var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')");
     20  f.load();
     21  document.fonts.add(f);
     22  await document.fonts.ready;
     23  ctx.font = '50px CanvasTest';
     24  ctx.fillStyle = '#f00';
     25  ctx.fillRect(0, 0, 100, 50);
     26  ctx.fillStyle = '#0f0';
     27  ctx.fillText('E\x0b EE', -150, 37.5);
     28  _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2);
     29  _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2);
     30 
     31 }, "Non-space characters are not converted to U+0020 and collapsed");
     32 </script>