4 <title>Test for WK94377: canvas.context.drawImage() should draw SVG images at the correct scale.
</title>
8 This test passes if there is a
100 x
100 green rect.
<br/>
9 <canvas id=
"canvas" width=
"200" height=
"200"></canvas>
10 <img id=
"image" width=
"200" height=
"200" style=
"visibility: hidden;" src=
"resources/100px-green-rect.svg"></img>
13 function finishTest() {
14 var image
= document
.getElementById("image");
15 var canvas
= document
.getElementById("canvas");
16 setTimeout(function() {
17 var context
= canvas
.getContext('2d');
18 // We draw the 200x200 image that contains a 100x100 green rect.
19 context
.drawImage(image
, 0, 0, 200, 200);
21 if (window
.testRunner
)
22 testRunner
.notifyDone();
26 image
.onload = function() {
27 if (window
.testRunner
) {
28 testRunner
.waitUntilDone();
29 testRunner
.setBackingScaleFactor(2, finishTest
);