Make Element.set_attr require an AbstractNode so we can always downcast.

This commit is contained in:
Josh Matthews 2013-09-12 14:36:06 -07:00
parent 72b6978b24
commit a410651fba
6 changed files with 42 additions and 19 deletions

View file

@ -79,9 +79,13 @@ impl HTMLImageElement {
}
}
pub fn SetWidth(&mut self, width: u32, _rv: &mut ErrorResult) {
pub fn SetWidth(&mut self,
abstract_self: AbstractNode<ScriptView>,
width: u32,
_rv: &mut ErrorResult) {
let node = &mut self.parent.parent;
node.set_attr(&str(~"width"),
node.set_attr(abstract_self,
&str(~"width"),
&str(width.to_str()));
}
@ -114,9 +118,13 @@ impl HTMLImageElement {
}
}
pub fn SetHeight(&mut self, height: u32, _rv: &mut ErrorResult) {
pub fn SetHeight(&mut self,
abstract_self: AbstractNode<ScriptView>,
height: u32,
_rv: &mut ErrorResult) {
let node = &mut self.parent.parent;
node.set_attr(&str(~"height"),
node.set_attr(abstract_self,
&str(~"height"),
&str(height.to_str()));
}