Bug 916128: Force canvas element size to >= 1 to match the behavior in the contexts. r=bas

This commit is contained in:
Milan Sreckovic 2013-10-03 14:47:42 -04:00
parent 207e44d021
commit c9b14bf386

View File

@ -154,12 +154,18 @@ HTMLCanvasElement::GetWidthHeight()
value->Type() == nsAttrValue::eInteger)
{
size.width = value->GetIntegerValue();
if (size.width <= 0) {
size.width = 1;
}
}
if ((value = GetParsedAttr(nsGkAtoms::height)) &&
value->Type() == nsAttrValue::eInteger)
{
size.height = value->GetIntegerValue();
if (size.height <= 0) {
size.height = 1;
}
}
return size;