tor-browser

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

reftest_offscreen_grid.html (1891B)


      1 <!DOCTYPE html>
      2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
      3 <meta charset="UTF-8">
      4 <link rel="stylesheet" href="/html/canvas/resources/canvas-grid-reftest.css">
      5 {% if test_type == 'promise' %}<html class="reftest-wait">
      6 <script>pending_tests = {{ variants | length }};</script>
      7 {% endif %}
      8 <link rel="match" href="{{ reference_file_link }}">
      9 {% if fuzzy %}<meta name=fuzzy content="{{ fuzzy }}">
     10 {% endif %}
     11 {% if timeout %}<meta name="timeout" content="{{ timeout }}">
     12 {% endif %}
     13 <title>Canvas test: {{ name }}</title>
     14 <h1>{{ name }}</h1>
     15 <p class="desc">{{ desc }}</p>
     16 {% if notes %}<p class="notes">{{ notes }}{% endif %}
     17 
     18 <div class="grid-container" style="--grid-width: {{ grid_width }}">
     19 {% for variant in variants %}
     20 <span>
     21  {% for variant_name in variant.grid_variant_names %}
     22  <div>{{ variant_name }}</div>
     23  {% endfor %}
     24  <canvas class="grid-cell-content" id="canvas{{ variant.id
     25      }}" width="{{ variant.size[0]
     26      }}" height="{{ variant.size[1]
     27      }}"{{ variant.canvas }}>
     28    <p class="fallback">FAIL (fallback content)</p>
     29  </canvas>
     30  <script type="module">
     31    const canvas = new OffscreenCanvas({{ variant.size[0] }}, {{
     32                                          variant.size[1] }});
     33    const ctx = canvas.getContext('2d'{%
     34        if variant.attributes %}, {{ variant.attributes }}{% endif %});
     35 
     36    {{ variant.code | trim | indent(4) }}
     37 
     38    const outputCanvas = document.getElementById("canvas{{ variant.id }}");
     39    const outputCtx = outputCanvas.getContext('2d'{%
     40        if variant.attributes %}, {{ variant.attributes }}{% endif %});
     41    outputCtx.drawImage(canvas, 0, 0);
     42 {% if test_type == 'promise' %}
     43    if (--pending_tests == 0) {
     44      document.documentElement.classList.remove("reftest-wait");
     45    }
     46 {% endif %}
     47  </script>
     48 </span>
     49 
     50 {% endfor %}
     51 </div>
     52 {% if test_type == 'promise' %}</html>{% endif %}