diff options
Diffstat (limited to 'testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation')
20 files changed, 412 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-orientation-none-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-orientation-none-ref.html new file mode 100644 index 0000000000..320a9b8108 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-orientation-none-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>reference for drawImage from a createImageBitmap source with image orientation: none</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> + <img id="img-element" style="image-orientation: none;" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-orientation-none.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-orientation-none.tentative.html new file mode 100644 index 0000000000..39ed4a25dc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-orientation-none.tentative.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from an element source with image orientation: none</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-from-bitmap-orientation-none-ref.html"> + <script> + image = new Image(); + image.src = "/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"; + + let imageLoadPromise = new Promise(resolve => { + image.onload = resolve; + }); + let contentLoadedPromise = new Promise(resolve => { + window.addEventListener('DOMContentLoaded', resolve); + }); + Promise.all([imageLoadPromise, contentLoadedPromise]).then( function() { + const can = document.getElementById('bitmap-canvas'); + can.height = 50; + can.width = 100; + can.getContext('2d').drawImage(image, 0, 0); + }) + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> + <canvas id="bitmap-canvas" style="image-orientation: none;"></canvas> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-ref.html new file mode 100644 index 0000000000..261d6a0b7c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>reference for drawImage from a createImageBitmap source with image orientation: from-image</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height-orientation-none-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height-orientation-none-ref.html new file mode 100644 index 0000000000..3a78aad068 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height-orientation-none-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>reference for drawImage from a createImageBitmap source with image orientation: none</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> + <img id="img-element" style="image-orientation: none;" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height-orientation-none.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height-orientation-none.tentative.html new file mode 100644 index 0000000000..3b16241c97 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height-orientation-none.tentative.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from an element source with image orientation: none</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-from-bitmap-swap-width-height-orientation-none-ref.html"> + <script> + image = new Image(); + image.src = "/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"; + + let imageLoadPromise = new Promise(resolve => { + image.onload = resolve; + }); + let contentLoadedPromise = new Promise(resolve => { + window.addEventListener('DOMContentLoaded', resolve); + }); + Promise.all([imageLoadPromise, contentLoadedPromise]).then( async function() { + const bitmap = await createImageBitmap(image); + const can = document.getElementById('bitmap-canvas'); + can.height = 50; + can.width = 100; + can.getContext('2d').drawImage(bitmap, 0, 0); + }) + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> + <canvas id="bitmap-canvas" style="image-orientation: none;"></canvas> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height-ref.html new file mode 100644 index 0000000000..247d7f4049 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>reference for drawImage from a createImageBitmap source with image orientation: from-image</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height.tentative.html new file mode 100644 index 0000000000..744ca54f47 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height.tentative.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from an element source with image orientation: from-image</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-from-bitmap-swap-width-height-ref.html"> + <script> + image = new Image(); + image.src = "/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"; + + let imageLoadPromise = new Promise(resolve => { + image.onload = resolve; + }); + let contentLoadedPromise = new Promise(resolve => { + window.addEventListener('DOMContentLoaded', resolve); + }); + Promise.all([imageLoadPromise, contentLoadedPromise]).then( async function() { + const bitmap = await createImageBitmap(image); + const can = document.getElementById('bitmap-canvas'); + can.height = 100; + can.width = 50; + can.getContext('2d').drawImage(bitmap, 0, 0); + }) + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> + <canvas id="bitmap-canvas"></canvas> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap.tentative.html new file mode 100644 index 0000000000..632a170b88 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap.tentative.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from an element source with image orientation: from-image</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-from-bitmap-ref.html"> + <script> + image = new Image(); + image.src = "/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"; + + let imageLoadPromise = new Promise(resolve => { + image.onload = resolve; + }); + let contentLoadedPromise = new Promise(resolve => { + window.addEventListener('DOMContentLoaded', resolve); + }); + Promise.all([imageLoadPromise, contentLoadedPromise]).then( function() { + const can = document.getElementById('bitmap-canvas'); + can.height = 50; + can.width = 100; + can.getContext('2d').drawImage(image, 0, 0); + }) + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> + <canvas id="bitmap-canvas"></canvas> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-blob-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-blob-ref.html new file mode 100644 index 0000000000..2bd6037835 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-blob-ref.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from a blob with image orientation: from-image, reference</title> +</head> +<body> + <img id="img-element" style="width: 150px; height: 300px;" src="/css/css-images/image-orientation/support/exif-orientation-8-llo.jpg"> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-blob.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-blob.tentative.html new file mode 100644 index 0000000000..330b3cbfe5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-blob.tentative.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html class="reftest-wait"> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from a blob with image orientation: from-image</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-from-blob-ref.html"> + <script> + function makeBlob() { + return new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/css/css-images/image-orientation/support/exif-orientation-8-llo.jpg'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + } + + window.onload = function() { + var cfb = document.getElementById("canvasWithFileBitmap"); + makeBlob().then(function(blob){createImageBitmap(blob).then(bitmap => { + cfb.getContext("2d").drawImage(bitmap, 0, 0, 150, 150 * bitmap.height / bitmap.width); + window.requestAnimationFrame(() => { + document.documentElement.removeAttribute("class"); + }); + }); + }); + } +</script> +</head> +<body> + <canvas id="canvasWithFileBitmap" width="150" height="300"></canvas> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-orientation-none-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-orientation-none-ref.html new file mode 100644 index 0000000000..b847b9eb73 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-orientation-none-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>reference for drawImage from an element source with image orientation: none</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> + <img id="img-element" style="image-orientation: none;" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-orientation-none.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-orientation-none.tentative.html new file mode 100644 index 0000000000..61563da738 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-orientation-none.tentative.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from an element source with image orientation: none</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-from-element-orientation-none-ref.html"> + <script> + window.onload = () => { + const img = document.getElementById('img-element'); + + const can = document.getElementById('bitmap-canvas'); + can.height = img.height; + can.width = img.width; + can.getContext('2d').drawImage(img, 0, 0); + }; + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> + <canvas id="bitmap-canvas" style="image-orientation: none;"></canvas> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-ref.html new file mode 100644 index 0000000000..3f4d1e5ff4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>reference for drawImage from an element source with image orientation: from-image</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height-orientation-none-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height-orientation-none-ref.html new file mode 100644 index 0000000000..b26154b40a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height-orientation-none-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>reference drawImage from an element source with image orientation: none</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> + <img id="img-element" style="image-orientation: none;" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height-orientation-none.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height-orientation-none.tentative.html new file mode 100644 index 0000000000..290d7acf3a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height-orientation-none.tentative.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from an element source with image orientation: none</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-from-element-swap-width-height-orientation-none-ref.html"> + <script> + window.onload = () => { + const img = document.getElementById('img-element'); + + const can = document.getElementById('bitmap-canvas'); + can.height = 50; + can.width = 100; + can.getContext('2d').drawImage(img, 0, 0); + }; + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> + <canvas id="bitmap-canvas" style="image-orientation: none;"></canvas> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height-ref.html new file mode 100644 index 0000000000..21f0f88b88 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>reference drawImage from an element source with image orientation: from-image</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height.tentative.html new file mode 100644 index 0000000000..20d59358b4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height.tentative.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from an element source with image orientation: from-image</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-from-element-swap-width-height-ref.html"> + <script> + window.onload = () => { + const img = document.getElementById('img-element'); + + const can = document.getElementById('bitmap-canvas'); + can.height = 100; + can.width = 50; + can.getContext('2d').drawImage(img, 0, 0); + }; + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-7-rl.jpg"> + <canvas id="bitmap-canvas"></canvas> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element.tentative.html new file mode 100644 index 0000000000..62cdf20c79 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-from-element.tentative.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>createImageBitmap and drawImage from an element source with image orientation: from-image</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-from-element-ref.html"> + <script> + window.onload = () => { + const img = document.getElementById('img-element'); + + const can = document.getElementById('bitmap-canvas'); + can.height = img.height; + can.width = img.width; + can.getContext('2d').drawImage(img, 0, 0); + }; + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> + <canvas id="bitmap-canvas"></canvas> +</body> +</html> diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-with-src-rect-ref.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-with-src-rect-ref.html new file mode 100644 index 0000000000..19ffcc39c9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-with-src-rect-ref.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>reference for drawImage with image orientation: from-image and a sub-image source rect</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> + <script> + window.onload = () => { + const img = document.getElementById('img-element'); + + const can = document.getElementById('bitmap-canvas'); + can.height = img.height; + can.width = img.width; + can.getContext('2d').drawImage(img, 40, 20, 50, 25, 0, 0, can.width, can.height); + }; + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr-pre-rotated.jpg"> + <canvas id="bitmap-canvas"></canvas> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-with-src-rect.tentative.html b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-with-src-rect.tentative.html new file mode 100644 index 0000000000..d889e39302 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/manual/drawing-images-to-the-canvas/image-orientation/drawImage-with-src-rect.tentative.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>drawImage with image orientation: from-image and a sub-image source rect</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="drawImage-with-src-rect-ref.html"> +<meta name=fuzzy content="0-3;0-200"> + <script> + window.onload = () => { + const img = document.getElementById('img-element'); + + const can = document.getElementById('bitmap-canvas'); + can.height = img.height; + can.width = img.width; + can.getContext('2d').drawImage(img, 40, 20, 50, 25, 0, 0, can.width, can.height); + }; + </script> +</head> +<body> + <img id="img-element" src="/css/css-images/image-orientation/support/exif-orientation-3-lr.jpg"> + <canvas id="bitmap-canvas"></canvas> +</body> +</html> |