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 1a40394872
commit 4fdf7dc46d

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;