gecko-dev/layout/reftests/bugs/1219985-3.html
Markus Stange 90d2624508 Bug 1219985 - The canvas rendering context 2d should be opaque if either the moz-opaque attribute is set or if it has been initialized with alpha:false. r=jrmuizel
If the canvas is cleared by setting the width or height attributes, its
opaqueness should not be affected.

This patch keeps support for moz-opaque, and also keeps the behavior that
changing the moz-opaque attribute clears the canvas, even if this does not
affect the actual opaqueness of the canvas.

MozReview-Commit-ID: LOlsJxiP9kc

--HG--
extra : rebase_source : 8bb95b1d5932c39a8085e007f9fd1b88b97afe55
2018-05-02 11:23:53 -04:00

17 lines
398 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>Bug 1219985: Basic rendering into a non-alpha canvas</title>
<div style="width: 200px; height: 200px; background-color: red;">
<canvas id="c" width="200" height="200"></canvas>
</div>
<script>
var c = document.getElementById('c');
var ctx = c.getContext('2d', { alpha: false });
ctx.fillStyle = 'green';
ctx.fillRect(50, 50, 100, 100);
</script>