| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-svg.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-svg.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-svg.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..013e0f1bf9f159891a64b033cbbfe2117eeb30ae
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-svg.html
|
| @@ -0,0 +1,40 @@
|
| +<!doctype html>
|
| +<style>
|
| +svg {
|
| + display: none;
|
| +}
|
| +canvas {
|
| + border: 1px solid black;
|
| +}
|
| +</style>
|
| +
|
| +<svg id="s1" width="20px" height="20px">
|
| + <image id="img1" xlink:href="resources/pattern.png" x="0" y="0" width="20px" height="20px" />
|
| + <image id="img2" xlink:href="resources/pattern.png" x="0" y="0" width="40px" height="40px" />
|
| + <image id="img3" xlink:href="resources/pattern.png" x="0" y="0" width="40px" height="40px" />
|
| + <image id="img4" xlink:href="invalid" x="0" y="0" width="20px" height="20px" />
|
| + <image id="img5" xlink:href="resources/pattern.png" x="0" y="0" width="20px" height="20px" />
|
| +</svg>
|
| +
|
| +<canvas id="c1" width="20" height="20"></canvas>
|
| +<canvas id="c2" width="20" height="20"></canvas>
|
| +<canvas id="c3" width="20" height="20"></canvas>
|
| +<canvas id="c4" width="20" height="20"></canvas>
|
| +<canvas id="c5" width="20" height="20"></canvas>
|
| +
|
| +<script>
|
| +var draw = function(target, img, x, y) {
|
| + document.getElementById(img).addEventListener("load", function() {
|
| + document.getElementById(target).getContext("2d").drawImage(
|
| + document.getElementById(img), x || 0, y || 0);
|
| + });
|
| +};
|
| +
|
| +draw("c1", "img1");
|
| +draw("c2", "img2", 10, 10);
|
| +draw("c3", "img3");
|
| +draw("c4", "img4");
|
| +document.getElementById("c5").getContext("2d").drawImage(
|
| + document.getElementById("img5"), 0, 0);
|
| +
|
| +</script>
|
|
|