Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html class="reftest-wait">
<title>Canvas.drawElementImage: content draws correct with object-fit: fill in a wide box</title>
<link rel="help" href="https://github.com/WICG/html-in-canvas">
<link rel="author" href="mailto:schenney@chromium.org">
<link rel="match" href="css-object-fit-fill-wide-ref.html">
<meta name=fuzzy content="0-16;0-800">
<script src="/common/reftest-wait.js"></script>
<script src="/html/canvas/resources/wait-for-canvas-paint.js"></script>
<style>
#child {
width: 200px;
height: 200px;
background: green;
}
#canvas {
aspect-ratio: 4/3;
object-fit: fill;
background-color: gray;
height: 300px;
}
</style>
<canvas id=canvas width="300" height="300" content=drawable>
<div drawable id=child></div>
</canvas>
<script>
onload = async () => {
await waitForCanvasPaint(canvas);
canvas.getContext("2d").drawElementImage(child, 45, 45);
takeScreenshot();
};
</script>
</html>