Index: third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-image-globalalpha.html |
diff --git a/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-image-globalalpha.html b/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-image-globalalpha.html |
index dec138209f64701cf77e4e90b0cbe4df24061356..d96a27b3d81234387c645688267e5380405b51fb 100644 |
--- a/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-image-globalalpha.html |
+++ b/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-image-globalalpha.html |
@@ -2,8 +2,11 @@ |
<canvas width=100 height=100></canvas> |
<script> |
var img = new Image(); |
+img.onload = imgOnLoad; |
img.src = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="#008000"/></svg>'; |
-var c = document.querySelector('canvas').getContext('2d'); |
-c.globalAlpha = 0.5; |
-c.drawImage(img, 0, 0); |
+function imgOnLoad() { |
+ var c = document.querySelector('canvas').getContext('2d'); |
+ c.globalAlpha = 0.5; |
+ c.drawImage(img, 0, 0); |
+} |
</script> |