reftest_element_grid.html (1966B)
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 {% if reference_file_link %} 9 <link rel="match" href="{{ reference_file_link }}"> 10 {% if fuzzy %}<meta name=fuzzy content="{{ fuzzy }}"> 11 {% endif %} 12 {% endif %} 13 {% if timeout %}<meta name="timeout" content="{{ timeout }}"> 14 {% endif %} 15 <title>Canvas test: {{ name }}</title> 16 <h1>{{ name }}</h1> 17 <p class="desc">{{ desc }}</p> 18 {% if notes %}<p class="notes">{{ notes }}{% endif %} 19 {% for image in images %} 20 <img src="/images/{{ image }}" id="{{ image }}" class="resource"> 21 {% endfor -%} 22 {% for svgimage in svgimages %} 23 <svg><image xlink:href="/images/{{ svgimage }}" id="{{ svgimage 24 }}" class="resource"></svg> 25 {% endfor %} 26 27 <div class="grid-container" style="--grid-width: {{ grid_width }}"> 28 {% for variant in variants %} 29 <span> 30 {% for variant_name in variant.grid_variant_names %} 31 <div>{{ variant_name }}</div> 32 {% endfor %} 33 <canvas class="grid-cell-content" id="canvas{{ variant.id 34 }}" width="{{ variant.size[0] 35 }}" height="{{ variant.size[1] 36 }}"{{ variant.canvas }}> 37 <p class="fallback">FAIL (fallback content)</p> 38 </canvas> 39 <script type="module"> 40 const canvas = document.getElementById("canvas{{ variant.id }}"); 41 const ctx = canvas.getContext('2d'{% 42 if variant.attributes %}, {{ variant.attributes }}{% endif %}); 43 44 {{ variant.reference | trim | indent(4) if not reference_file_link else 45 variant.code | trim | indent(4) }} 46 {% if test_type == 'promise' %} 47 if (--pending_tests == 0) { 48 document.documentElement.classList.remove("reftest-wait"); 49 } 50 {% endif %} 51 </script> 52 </span> 53 54 {% endfor %} 55 </div> 56 {% if test_type == 'promise' %}</html>{% endif %}