summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.strokeStyle.redirect.html
blob: 09df15d24fb271833523d523d9387362825ea6a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>Canvas test: security.pattern.image.strokeStyle.redirect</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
<body class="show_output">

<h1>security.pattern.image.strokeStyle.redirect</h1>
<p class="desc">Setting strokeStyle to a pattern of a different-origin image makes the canvas origin-unclean</p>


<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>

<ul id="d"></ul>
<script>
var t = async_test("Setting strokeStyle to a pattern of a different-origin image makes the canvas origin-unclean");
_addTest(function(canvas, ctx) {

var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat');
ctx.strokeStyle = p;
ctx.strokeStyle = 'red';
assert_throws_dom("SECURITY_ERR", function() { canvas.toDataURL(); });
assert_throws_dom("SECURITY_ERR", function() { ctx.getImageData(0, 0, 1, 1); });


});
</script>
<script src="/common/get-host-info.sub.js"></script>
<script src="data:text/javascript,addCrossOriginRedirectYellowImage()"></script>