blob: 927656fe53a8506d43c1d8a5842eacc2266ea754 [file] [log] [blame]
<!DOCTYPE html>
<title>Canvas test: 2d.clearRect+fillRect.alpha0</title>
<script src="../tests.js"></script>
<link rel="stylesheet" href="../tests.css">
<body class="show_output">
<p>
<a href="index.html">[index]</a>
<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a></h1>
<p class="desc">fillRect preceded by a clearRect (ctx.globalAlpha = 0.0) on the same area should show no side effects</p><div class="refs">
<div class="refs">References:
<ul>
<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
</ul>
</div>
<p class="output">Actual output:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
<ul id="d"></ul>
<script>
_addTest(function(canvas, ctx) {
ctx.fillStyle = '#f00';
ctx.fillRect(0, 0, 100, 50);
ctx.globalAlpha = 0.0;
ctx.clearRect(0, 0, 100, 50);
ctx.globalAlpha = 1.0;
ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
});
</script>