testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.html
author Serban Stanca <sstanca@mozilla.com>
Mon, 14 Jul 2025 00:37:50 +0300 (5 hours ago)
changeset 796395 57c30f1adca5fb5ccd4a9a09192c41e207e28d88
parent 752939 1996e4a4973941fa87e76e5646d5bb0088c0de84
permissions -rw-r--r--
Revert "Bug 1950748 part 3: Don't return a caret inside an editor when no editor is focused. r=morgan" as requested for causing accessibility crashes (bug 1977012). This reverts commit aaf970807d281c28c1e937491719d996cb11648a. This reverts commit f5f2e3cf4d34c2430372ba790d77620837d56b75. This reverts commit 5565c5899c32c0b0f5446561a21c5b6499fd44c6.
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<meta charset="UTF-8">
<title>OffscreenCanvas test: 2d.drawImage.floatsource</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>

<h1>2d.drawImage.floatsource</h1>
<p class="desc"></p>


<script>
promise_test(async t => {

  var canvas = new OffscreenCanvas(100, 50);
  var ctx = canvas.getContext('2d');

  const response = await fetch('/images/green.png');
  const blob = await response.blob();
  const bitmap = await createImageBitmap(blob);
  ctx.drawImage(bitmap, 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50);
  _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2);

}, "");
</script>