mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace the Str implementation for AttrValue by a Deref implementation.
This commit is contained in:
parent
4108af0c11
commit
41cc0a939e
16 changed files with 43 additions and 41 deletions
|
@ -130,18 +130,17 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLTableElement> {
|
|||
|
||||
match attr.local_name() {
|
||||
&atom!("bgcolor") => {
|
||||
self.background_color.set(str::parse_legacy_color(attr.value().as_slice()).ok())
|
||||
self.background_color.set(str::parse_legacy_color(&attr.value()).ok())
|
||||
}
|
||||
&atom!("border") => {
|
||||
// According to HTML5 § 14.3.9, invalid values map to 1px.
|
||||
self.border.set(Some(str::parse_unsigned_integer(attr.value()
|
||||
.as_slice()
|
||||
.chars()).unwrap_or(1)))
|
||||
}
|
||||
&atom!("cellspacing") => {
|
||||
self.cellspacing.set(str::parse_unsigned_integer(attr.value().as_slice().chars()))
|
||||
self.cellspacing.set(str::parse_unsigned_integer(attr.value().chars()))
|
||||
}
|
||||
&atom!("width") => self.width.set(str::parse_length(attr.value().as_slice())),
|
||||
&atom!("width") => self.width.set(str::parse_length(&attr.value())),
|
||||
_ => ()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue