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