Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-svg.html

Issue 2723093004: Adds SVGImageElement as a CanvasImageSource (Closed)
Patch Set: Tests added Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <style>
3 svg {
4 display: none;
5 }
6 canvas {
7 border: 1px solid black;
8 }
9 </style>
10
11 <svg id="s1" width="20px" height="20px">
12 <image id="img1" xlink:href="resources/pattern.png" x="0" y="0" width="20px" h eight="20px" />
13 <image id="img2" xlink:href="resources/pattern.png" x="0" y="0" width="40px" h eight="40px" />
14 <image id="img3" xlink:href="resources/pattern.png" x="0" y="0" width="40px" h eight="40px" />
15 <image id="img4" xlink:href="invalid" x="0" y="0" width="20px" height="20px" / >
16 <image id="img5" xlink:href="resources/pattern.png" x="0" y="0" width="20px" h eight="20px" />
17 </svg>
18
19 <canvas id="c1" width="20" height="20"></canvas>
20 <canvas id="c2" width="20" height="20"></canvas>
21 <canvas id="c3" width="20" height="20"></canvas>
22 <canvas id="c4" width="20" height="20"></canvas>
23 <canvas id="c5" width="20" height="20"></canvas>
24
25 <script>
26 var draw = function(target, img, x, y) {
27 document.getElementById(img).addEventListener("load", function() {
28 document.getElementById(target).getContext("2d").drawImage(
29 document.getElementById(img), x || 0, y || 0);
30 });
31 };
32
33 draw("c1", "img1");
34 draw("c2", "img2", 10, 10);
35 draw("c3", "img3");
36 draw("c4", "img4");
37 document.getElementById("c5").getContext("2d").drawImage(
38 document.getElementById("img5"), 0, 0);
39
40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698