Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / object-fit-canvas-expected.html
blob64aa98ae3b0432f6a10fa6db4bf72340c587f645
1 <!DOCTYPE html>
3 <html>
4 <head>
5 <title>object-fit on canvas</title>
6 <style type="text/css">
7 .group > div {
8 display: inline-block;
9 overflow: hidden;
10 width: 72px;
11 height: 72px;
12 margin: 2px 10px;
13 border: 1px solid black;
14 background-color: gray;
17 .group > * > * { display: block; }
18 .group > *:nth-child(1) * { width:100%; height:100%; }
19 .group > *:nth-child(2) * { width:100%; margin-top:25%; }
20 .group > *:nth-child(3) * { height:100%; margin-left:-50%; }
21 .group > *:nth-child(4) * { width:288px; margin-left:-108px; margin-top:-36px; }
22 .group > *:nth-child(5) * { width:100%; margin-top:25%; }
23 .group > *:nth-child(6) * { width:100%; margin-top:25%; }
24 .group > *:nth-child(7) * { width:100%; height:100%; }
25 </style>
26 <script type="text/javascript" charset="utf-8">
27 if (window.testRunner)
28 testRunner.waitUntilDone();
30 var circlesImage;
32 function paintCanvas(canvas)
34 var ctx = canvas.getContext('2d');
35 ctx.drawImage(circlesImage, 0, 0);
38 function init()
40 circlesImage = new Image()
41 circlesImage.addEventListener('load', imageLoaded, false);
42 circlesImage.src = "resources/circles-landscape.png";
45 function imageLoaded()
47 var canvases = document.getElementsByTagName('canvas');
48 for (var i = 0; i < canvases.length; ++i)
49 paintCanvas(canvases[i])
50 if (window.testRunner)
51 testRunner.notifyDone();
54 window.addEventListener('load', init, false);
55 </script>
56 </head>
57 <body>
59 <div class="group">
60 <div><canvas width="288" height="144"></canvas></div>
61 <div><canvas width="288" height="144"></canvas></div>
62 <div><canvas width="288" height="144"></canvas></div>
63 <div><canvas width="288" height="144"></canvas></div>
64 <div><canvas width="288" height="144"></canvas></div>
65 <div><canvas width="288" height="144"></canvas></div>
66 <div><canvas width="288" height="144"></canvas></div>
67 </div>
69 </body>
70 </html>