tor-browser

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

2d.strokeRect.nonfinite.html (1897B)


      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.strokeRect.nonfinite</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.strokeRect.nonfinite</h1>
     10 <p class="desc">strokeRect() with Infinity/NaN is ignored</p>
     11 
     12 
     13 <script>
     14 var t = async_test("strokeRect() with Infinity/NaN is ignored");
     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  ctx.fillStyle = '#0f0';
     25  ctx.fillRect(0, 0, 100, 50);
     26  ctx.strokeStyle = '#f00';
     27  ctx.lineWidth = 150;
     28  ctx.strokeRect(Infinity, 0, 100, 50);
     29  ctx.strokeRect(-Infinity, 0, 100, 50);
     30  ctx.strokeRect(NaN, 0, 100, 50);
     31  ctx.strokeRect(0, Infinity, 100, 50);
     32  ctx.strokeRect(0, -Infinity, 100, 50);
     33  ctx.strokeRect(0, NaN, 100, 50);
     34  ctx.strokeRect(0, 0, Infinity, 50);
     35  ctx.strokeRect(0, 0, -Infinity, 50);
     36  ctx.strokeRect(0, 0, NaN, 50);
     37  ctx.strokeRect(0, 0, 100, Infinity);
     38  ctx.strokeRect(0, 0, 100, -Infinity);
     39  ctx.strokeRect(0, 0, 100, NaN);
     40  ctx.strokeRect(Infinity, Infinity, 100, 50);
     41  ctx.strokeRect(Infinity, Infinity, Infinity, 50);
     42  ctx.strokeRect(Infinity, Infinity, Infinity, Infinity);
     43  ctx.strokeRect(Infinity, Infinity, 100, Infinity);
     44  ctx.strokeRect(Infinity, 0, Infinity, 50);
     45  ctx.strokeRect(Infinity, 0, Infinity, Infinity);
     46  ctx.strokeRect(Infinity, 0, 100, Infinity);
     47  ctx.strokeRect(0, Infinity, Infinity, 50);
     48  ctx.strokeRect(0, Infinity, Infinity, Infinity);
     49  ctx.strokeRect(0, Infinity, 100, Infinity);
     50  ctx.strokeRect(0, 0, Infinity, Infinity);
     51  _assertPixel(canvas, 50,25, 0,255,0,255);
     52  t.done();
     53 
     54 });
     55 </script>