Bug 798802 - Fix layer uninitialised in nsHTMLCanvasElement::InvalidateCanvasContent(). r=mattwoodrow

This commit is contained in:
Anthony Jones 2012-10-11 21:31:39 -04:00
parent 3cdb713c07
commit cc38702572
3 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,18 @@
<html>
<head>
<script>
onload = function() {
var canvas2d = document.createElement('canvas')
canvas2d.setAttribute('width', 0)
document.body.appendChild(canvas2d)
var ctx2d = canvas2d.getContext('2d')
ctx2d.fillStyle = 'black'
var gl = document.createElement('canvas').getContext('experimental-webgl')
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d)
ctx2d.fillRect(0, 0, 1, 1)
}
</script>
</head>
<body>
</body>
</html>

View File

@ -41,3 +41,4 @@ load 795221-2.html
load 795221-3.html load 795221-3.html
load 795221-4.html load 795221-4.html
load 795221-5.xml load 795221-5.xml
load 798802-1.html

View File

@ -836,7 +836,7 @@ nsHTMLCanvasElement::InvalidateCanvasContent(const gfxRect* damageRect)
frame->MarkLayersActive(nsChangeHint(0)); frame->MarkLayersActive(nsChangeHint(0));
Layer* layer; Layer* layer = nullptr;
if (damageRect) { if (damageRect) {
nsIntSize size = GetWidthHeight(); nsIntSize size = GetWidthHeight();
if (size.width != 0 && size.height != 0) { if (size.width != 0 && size.height != 0) {