aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-09-03 19:55:06 +0200
committerMs2ger <ms2ger@gmail.com>2014-09-03 20:14:27 +0200
commit2d50e33902ff41cad176703e4fecebae2643cf72 (patch)
tree68510085f6742a1fc5aeeaff1ca12ed41890bd11 /src/components/script
parente1b5b5183fc106db6358d3b6e6526591c19e968c (diff)
downloadservo-2d50e33902ff41cad176703e4fecebae2643cf72.tar.gz
servo-2d50e33902ff41cad176703e4fecebae2643cf72.zip
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.
Diffstat (limited to 'src/components/script')
-rw-r--r--src/components/script/dom/htmlcanvaselement.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/script/dom/htmlcanvaselement.rs b/src/components/script/dom/htmlcanvaselement.rs
index 5d6f09badce..28902265610 100644
--- a/src/components/script/dom/htmlcanvaselement.rs
+++ b/src/components/script/dom/htmlcanvaselement.rs
@@ -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,