Handle failure to parse the value of the width and height attributes on canvas elements (fixes #3200).

The remaining failures are due to the tests's use of getComputedStyle.
This commit is contained in:
Ms2ger 2014-09-03 19:55:06 +02:00
parent e1b5b5183f
commit 2d50e33902
23 changed files with 44 additions and 40 deletions

View file

@ -133,11 +133,11 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLCanvasElement> {
let recreate = match name.as_slice() {
"width" => {
self.width.set(parse_unsigned_integer(value.as_slice().chars()).unwrap());
self.width.set(parse_unsigned_integer(value.as_slice().chars()).unwrap_or(DefaultWidth));
true
}
"height" => {
self.height.set(parse_unsigned_integer(value.as_slice().chars()).unwrap());
self.height.set(parse_unsigned_integer(value.as_slice().chars()).unwrap_or(DefaultHeight));
true
}
_ => false,