mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-06-13 08:29:57 +00:00
#612: M1019551
This commit is contained in:
parent
689819e12b
commit
7850b17a7d
|
@ -545,17 +545,23 @@ HTMLCanvasElement::CopyInnerTo(Element* aDest)
|
||||||
HTMLCanvasElement* dest = static_cast<HTMLCanvasElement*>(aDest);
|
HTMLCanvasElement* dest = static_cast<HTMLCanvasElement*>(aDest);
|
||||||
dest->mOriginalCanvas = this;
|
dest->mOriginalCanvas = this;
|
||||||
|
|
||||||
nsCOMPtr<nsISupports> cxt;
|
// We make sure that the canvas is not zero sized since that would cause
|
||||||
dest->GetContext(NS_LITERAL_STRING("2d"), getter_AddRefs(cxt));
|
// the DrawImage call below to return an error, which would cause printing
|
||||||
RefPtr<CanvasRenderingContext2D> context2d =
|
// to fail.
|
||||||
static_cast<CanvasRenderingContext2D*>(cxt.get());
|
nsIntSize size = GetWidthHeight();
|
||||||
if (context2d && !mPrintCallback) {
|
if (size.height > 0 && size.width > 0) {
|
||||||
CanvasImageSource source;
|
nsCOMPtr<nsISupports> cxt;
|
||||||
source.SetAsHTMLCanvasElement() = this;
|
dest->GetContext(NS_LITERAL_STRING("2d"), getter_AddRefs(cxt));
|
||||||
ErrorResult err;
|
RefPtr<CanvasRenderingContext2D> context2d =
|
||||||
context2d->DrawImage(source,
|
static_cast<CanvasRenderingContext2D*>(cxt.get());
|
||||||
0.0, 0.0, err);
|
if (context2d && !mPrintCallback) {
|
||||||
rv = err.StealNSResult();
|
CanvasImageSource source;
|
||||||
|
source.SetAsHTMLCanvasElement() = this;
|
||||||
|
ErrorResult err;
|
||||||
|
context2d->DrawImage(source,
|
||||||
|
0.0, 0.0, err);
|
||||||
|
rv = err.StealNSResult();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user