summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/canvas/element/manual/imagebitmap/imageBitmap-from-imageData-no-image-rotation.html
blob: e93c17c8e857d940f632ead6d6ee3fe7be505d75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<html>
  <link rel="match" href="imageBitmap-from-imageData-no-image-rotation-expected.html" />
  <style type="text/css">
    canvas {
      image-orientation: none;
    }
  </style>
<body>
  <canvas id="myCanvas" width="400" height="400"></canvas>
</body>>
<script>
var canvas = document.getElementById('myCanvas');
ctx = canvas.getContext('2d');
image = document.createElement("img");
image.src = "../../../resources/black_white.png"
image.onload = function() {
  Promise.all([
    // The image should be flipped and ignoring "image-orientation" setting
    // in css style.
    createImageBitmap(image, { imageOrientation: 'flipY' }),
    ]).then(function(sprites) {
  // Draw image onto the canvas
  ctx.drawImage(sprites[0], 0, 0);
});
}
</script>