Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / object-fit-canvas.html
blob540ca996af06da2a15f9c5374be41924ff19b4da
1 <!DOCTYPE html>
3 <html>
4 <head>
5 <title>object-fit on canvas</title>
6 <style type="text/css">
7 img, embed, object, input, canvas, video {
8 width: 72px;
9 height: 72px;
10 margin: 2px 10px;
11 border: 1px solid black;
12 background-color: gray;
15 .group { object-fit: contain; }
16 .group > *:nth-child(1) { object-fit: fill; }
17 .group > *:nth-child(2) { object-fit: contain; }
18 .group > *:nth-child(3) { object-fit: cover; }
19 .group > *:nth-child(4) { object-fit: none; }
20 .group > *:nth-child(5) { object-fit: scale-down; }
21 .group > *:nth-child(6) { object-fit: inherit; }
22 .group > *:nth-child(7) { }
23 </style>
24 <script type="text/javascript" charset="utf-8">
25 if (window.testRunner)
26 testRunner.waitUntilDone();
28 var circlesImage;
30 function paintCanvas(canvas)
32 var ctx = canvas.getContext('2d');
33 ctx.drawImage(circlesImage, 0, 0);
36 function init()
38 circlesImage = new Image()
39 circlesImage.addEventListener('load', imageLoaded, false);
40 circlesImage.src = "resources/circles-landscape.png";
43 function imageLoaded()
45 var canvases = document.getElementsByTagName('canvas');
46 for (var i = 0; i < canvases.length; ++i)
47 paintCanvas(canvases[i])
48 if (window.testRunner)
49 testRunner.notifyDone();
52 window.addEventListener('load', init, false);
53 </script>
54 </head>
55 <body>
57 <div class="group">
58 <canvas width="288" height="144"></canvas>
59 <canvas width="288" height="144"></canvas>
60 <canvas width="288" height="144"></canvas>
61 <canvas width="288" height="144"></canvas>
62 <canvas width="288" height="144"></canvas>
63 <canvas width="288" height="144"></canvas>
64 <canvas width="288" height="144"></canvas>
65 </div>
67 </body>
68 </html>