Cleanup attribute setting functions a bit.

This commit is contained in:
Ms2ger 2013-11-13 17:38:08 +01:00
parent 4eb8449621
commit 591de8cff5
3 changed files with 21 additions and 29 deletions

View file

@ -82,9 +82,7 @@ impl HTMLImageElement {
abstract_self: AbstractNode<ScriptView>,
src: &DOMString) -> ErrorResult {
let node = &mut self.htmlelement.element;
node.set_attr(abstract_self,
&Some(~"src"),
&Some(src.clone()));
node.set_attr(abstract_self, ~"src", src.clone());
Ok(())
}
@ -127,9 +125,7 @@ impl HTMLImageElement {
abstract_self: AbstractNode<ScriptView>,
width: u32) -> ErrorResult {
let node = &mut self.htmlelement.element;
node.set_attr(abstract_self,
&Some(~"width"),
&Some(width.to_str()));
node.set_attr(abstract_self, ~"width", width.to_str());
Ok(())
}
@ -148,9 +144,7 @@ impl HTMLImageElement {
abstract_self: AbstractNode<ScriptView>,
height: u32) -> ErrorResult {
let node = &mut self.htmlelement.element;
node.set_attr(abstract_self,
&Some(~"height"),
&Some(height.to_str()));
node.set_attr(abstract_self, ~"height", height.to_str());
Ok(())
}