tor-browser

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

2d.text.drawing.style.fontKerning.html (1244B)


      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.drawing.style.fontKerning</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.drawing.style.fontKerning</h1>
     10 <p class="desc">Testing basic functionalities of fontKerning for canvas</p>
     11 
     12 
     13 <script>
     14 var t = async_test("Testing basic functionalities of fontKerning for canvas");
     15 var t_pass = t.done.bind(t);
     16 var t_fail = t.step_func(function(reason) {
     17    throw reason;
     18 });
     19 t.step(function() {
     20 
     21  var canvas = new OffscreenCanvas(100, 50);
     22  var ctx = canvas.getContext('2d');
     23 
     24  _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\"");
     25  ctx.fontKerning = "normal";
     26  _assertSame(ctx.fontKerning, "normal", "ctx.fontKerning", "\"normal\"");
     27  width_normal = ctx.measureText("TAWATAVA").width;
     28  ctx.fontKerning = "none";
     29  _assertSame(ctx.fontKerning, "none", "ctx.fontKerning", "\"none\"");
     30  width_none = ctx.measureText("TAWATAVA").width;
     31  _assert(width_normal < width_none, "width_normal < width_none");
     32  t.done();
     33 
     34 });
     35 </script>