aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlelement.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-08-27 01:07:34 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-08-27 02:14:48 +0530
commitb33c5427bc350e42503e2de1a8f832c63522b2d0 (patch)
tree95c22ad6ae7e50ba07758f90ed0a6ce112debb32 /components/script/dom/htmlelement.rs
parent5e83a3f0a3bab226cca849ab33fa3322ef71813d (diff)
downloadservo-b33c5427bc350e42503e2de1a8f832c63522b2d0.tar.gz
servo-b33c5427bc350e42503e2de1a8f832c63522b2d0.zip
Remove doublepointer in VirtualMethods, and from_borrowed_ref
Most of the heavy lifting done by: ``` $ ls *rs | xargs gawk -i inplace '/let .*: &&.*from_borrowed_ref/{sub("&&", "\\&");sub("_borrowed_","_");} {print $0}' $ ls *rs | xargs gawk -i inplace "/impl.*VirtualMethods/{in_vm=1; sub(/<'a>/,\"\");sub(/&'a /,\"\")} /^}\$/{in_vm=0;} in_vm{\$0=gensub(/\\*self([^.])/,\"self\\\1\",\"g\"); sub(/from_borrowed_ref/,\"from_ref\")} {print}" ```
Diffstat (limited to 'components/script/dom/htmlelement.rs')
-rw-r--r--components/script/dom/htmlelement.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs
index 8b3e1863bca..d09c197cc5c 100644
--- a/components/script/dom/htmlelement.rs
+++ b/components/script/dom/htmlelement.rs
@@ -322,9 +322,9 @@ impl<'a> HTMLElementCustomAttributeHelpers for &'a HTMLElement {
}
}
-impl<'a> VirtualMethods for &'a HTMLElement {
+impl VirtualMethods for HTMLElement {
fn super_type<'b>(&'b self) -> Option<&'b VirtualMethods> {
- let element: &&Element = ElementCast::from_borrowed_ref(self);
+ let element: &Element = ElementCast::from_ref(self);
Some(element as &VirtualMethods)
}
@@ -348,11 +348,11 @@ impl<'a> VirtualMethods for &'a HTMLElement {
let name = attr.local_name();
if name.starts_with("on") {
- let window = window_from_node(*self);
+ let window = window_from_node(self);
let (cx, url, reflector) = (window.r().get_cx(),
window.r().get_url(),
window.r().reflector().get_jsobject());
- let evtarget = EventTargetCast::from_ref(*self);
+ let evtarget = EventTargetCast::from_ref(self);
evtarget.set_event_handler_uncompiled(cx, url, reflector,
&name[2..],
(**attr.value()).to_owned());