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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/canvas-remote-read-remote-svg-image.html

Issue 2723093004: Adds SVGImageElement as a CanvasImageSource (Closed)
Patch Set: Moved from circle to rect, to avoid aliasing 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 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <body></body>
5 <script>
6
7 async_test(function(t) {
8 var canvas = document.createElement("canvas");
9 canvas.width = canvas.height = 100;
10
11 var svg = document.createElementNS('http://www.w3.org/2000/svg','svg');
12 var image = document.createElementNS("http://www.w3.org/2000/svg", "image");
13 svg.appendChild(image);
14 image.setAttribute('href',
15 'http://localhost:8000/security/resources/red200x100.png');
16
17 var ctx = canvas.getContext("2d");
18
19 image.addEventListener('load', t.step_func_done(function() {
20 ctx.drawImage(image, 0, 0);
21
22 assert_throws("SecurityError", function() {
23 var c = ctx.getImageData(0, 0, 1, 1);
24 }, "We are trying cross-origin getImageData");
25 }));
26
27 document.body.appendChild(canvas);
28 document.body.appendChild(svg);
29 }, "Checks no cross-origin on tainted canvas due to SVG image");
30
31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698