mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1246775 - fix Canvas2D drawWindow to reacquire its DT after rendering. r=bas
This commit is contained in:
parent
c631aefd3b
commit
42a8ea393d
@ -4914,6 +4914,9 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& aWindow, double aX,
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell = presContext->PresShell();
|
||||
Unused << shell->RenderDocument(r, renderDocFlags, backgroundColor, thebes);
|
||||
// If this canvas was contained in the drawn window, the pre-transaction callback
|
||||
// may have returned its DT. If so, we must reacquire it here.
|
||||
EnsureTarget();
|
||||
if (drawDT) {
|
||||
RefPtr<SourceSurface> snapshot = drawDT->Snapshot();
|
||||
RefPtr<DataSourceSurface> data = snapshot->GetDataSurface();
|
||||
|
15
dom/canvas/crashtests/1246775-1.html
Normal file
15
dom/canvas/crashtests/1246775-1.html
Normal file
@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
function boom()
|
||||
{
|
||||
var canvas = document.getElementById("canvas");
|
||||
var ctx = SpecialPowers.wrap(canvas.getContext("2d"));
|
||||
ctx.drawWindow(window, 0, 0, canvas.width, canvas.height, "red");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom();">
|
||||
<canvas id="canvas" width="10" height="10"></canvas>
|
||||
</body>
|
||||
</html>
|
@ -29,4 +29,5 @@ skip-if(azureCairo) load 1229983-1.html
|
||||
load 1229932-1.html
|
||||
load 1233613.html
|
||||
load 1244850-1.html
|
||||
load 1246775-1.html
|
||||
load texImage2D.html
|
||||
|
Loading…
Reference in New Issue
Block a user