mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
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:
parent
e1b5b5183f
commit
2d50e33902
23 changed files with 44 additions and 40 deletions
|
@ -133,11 +133,11 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLCanvasElement> {
|
||||||
|
|
||||||
let recreate = match name.as_slice() {
|
let recreate = match name.as_slice() {
|
||||||
"width" => {
|
"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
|
true
|
||||||
}
|
}
|
||||||
"height" => {
|
"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
|
true
|
||||||
}
|
}
|
||||||
_ => false,
|
_ => false,
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.parse.em.html]
|
[size.attributes.parse.em.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[size.attributes.parse.empty.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.parse.exp.html]
|
[size.attributes.parse.exp.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.parse.hex.html]
|
[size.attributes.parse.hex.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[size.attributes.parse.junk.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +0,0 @@
|
||||||
[size.attributes.parse.minus.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +0,0 @@
|
||||||
[size.attributes.parse.onlyspace.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.parse.percent.html]
|
[size.attributes.parse.percent.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.parse.space.html]
|
[size.attributes.parse.space.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.parse.trailingjunk.html]
|
[size.attributes.parse.trailingjunk.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.parse.whitespace.html]
|
[size.attributes.parse.whitespace.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.setAttribute.em.html]
|
[size.attributes.setAttribute.em.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers in setAttribute]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[size.attributes.setAttribute.empty.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.setAttribute.exp.html]
|
[size.attributes.setAttribute.exp.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers in setAttribute]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.setAttribute.hex.html]
|
[size.attributes.setAttribute.hex.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers in setAttribute]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[size.attributes.setAttribute.junk.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +0,0 @@
|
||||||
[size.attributes.setAttribute.minus.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +0,0 @@
|
||||||
[size.attributes.setAttribute.onlyspace.html]
|
|
||||||
type: testharness
|
|
||||||
expected: TIMEOUT
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.setAttribute.percent.html]
|
[size.attributes.setAttribute.percent.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers in setAttribute]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.setAttribute.space.html]
|
[size.attributes.setAttribute.space.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers in setAttribute]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.setAttribute.trailingjunk.html]
|
[size.attributes.setAttribute.trailingjunk.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers in setAttribute]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[size.attributes.setAttribute.whitespace.html]
|
[size.attributes.setAttribute.whitespace.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: TIMEOUT
|
[Parsing of non-negative integers in setAttribute]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue