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,

View file

@ -1,3 +1,5 @@
[size.attributes.parse.em.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers]
expected: FAIL

View file

@ -1,3 +0,0 @@
[size.attributes.parse.empty.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +1,5 @@
[size.attributes.parse.exp.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers]
expected: FAIL

View file

@ -1,3 +1,5 @@
[size.attributes.parse.hex.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers]
expected: FAIL

View file

@ -1,3 +0,0 @@
[size.attributes.parse.junk.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +0,0 @@
[size.attributes.parse.minus.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +0,0 @@
[size.attributes.parse.onlyspace.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +1,5 @@
[size.attributes.parse.percent.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers]
expected: FAIL

View file

@ -1,3 +1,5 @@
[size.attributes.parse.space.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers]
expected: FAIL

View file

@ -1,3 +1,5 @@
[size.attributes.parse.trailingjunk.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers]
expected: FAIL

View file

@ -1,3 +1,5 @@
[size.attributes.parse.whitespace.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers]
expected: FAIL

View file

@ -1,3 +1,5 @@
[size.attributes.setAttribute.em.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers in setAttribute]
expected: FAIL

View file

@ -1,3 +0,0 @@
[size.attributes.setAttribute.empty.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +1,5 @@
[size.attributes.setAttribute.exp.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers in setAttribute]
expected: FAIL

View file

@ -1,3 +1,5 @@
[size.attributes.setAttribute.hex.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers in setAttribute]
expected: FAIL

View file

@ -1,3 +0,0 @@
[size.attributes.setAttribute.junk.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +0,0 @@
[size.attributes.setAttribute.minus.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +0,0 @@
[size.attributes.setAttribute.onlyspace.html]
type: testharness
expected: TIMEOUT

View file

@ -1,3 +1,5 @@
[size.attributes.setAttribute.percent.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers in setAttribute]
expected: FAIL

View file

@ -1,3 +1,5 @@
[size.attributes.setAttribute.space.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers in setAttribute]
expected: FAIL

View file

@ -1,3 +1,5 @@
[size.attributes.setAttribute.trailingjunk.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers in setAttribute]
expected: FAIL

View file

@ -1,3 +1,5 @@
[size.attributes.setAttribute.whitespace.html]
type: testharness
expected: TIMEOUT
[Parsing of non-negative integers in setAttribute]
expected: FAIL