mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Make Element.set_attr require an AbstractNode so we can always downcast.
This commit is contained in:
parent
72b6978b24
commit
a410651fba
6 changed files with 42 additions and 19 deletions
|
@ -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()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue