Introduce a set_uint_attribute method.

This commit is contained in:
Ms2ger 2014-04-06 14:19:30 +02:00
parent 4386bae576
commit bb732ef4e6
3 changed files with 10 additions and 6 deletions

View file

@ -144,9 +144,9 @@ impl HTMLImageElement {
to_px(rect.size.width) as u32
}
pub fn SetWidth(&mut self, abstract_self: &JS<HTMLImageElement>, width: u32) -> ErrorResult {
pub fn SetWidth(&mut self, abstract_self: &JS<HTMLImageElement>, width: u32) {
let mut elem: JS<Element> = ElementCast::from(abstract_self);
elem.set_attr(~"width", width.to_str())
elem.set_uint_attribute("width", width)
}
pub fn Height(&self, abstract_self: &JS<HTMLImageElement>) -> u32 {
@ -160,9 +160,9 @@ impl HTMLImageElement {
to_px(rect.size.height) as u32
}
pub fn SetHeight(&mut self, abstract_self: &JS<HTMLImageElement>, height: u32) -> ErrorResult {
pub fn SetHeight(&mut self, abstract_self: &JS<HTMLImageElement>, height: u32) {
let mut elem: JS<Element> = ElementCast::from(abstract_self);
elem.set_attr(~"height", height.to_str())
elem.set_uint_attribute("height", height)
}
pub fn NaturalWidth(&self) -> u32 {