diff options
author | Cameron Zwarich <zwarich@mozilla.com> | 2014-09-20 12:55:21 -0700 |
---|---|---|
committer | Cameron Zwarich <zwarich@mozilla.com> | 2014-09-20 12:55:21 -0700 |
commit | d6ba37c68c34a3748a789caeca225083275757e5 (patch) | |
tree | f7d0a43047979744a3ef2490db1cdaf907870ea1 /components/script/dom/htmlanchorelement.rs | |
parent | 545e9884a6907f04814c6008699c2bbcfef22edd (diff) | |
parent | 8aec08074c1535d2c8c9d3bb2208c6f83b82114e (diff) | |
download | servo-d6ba37c68c34a3748a789caeca225083275757e5.tar.gz servo-d6ba37c68c34a3748a789caeca225083275757e5.zip |
Merge pull request #3433 from zwarich/jsref-self-helpers
More progress in the &JSRef -> JSRef conversion
Diffstat (limited to 'components/script/dom/htmlanchorelement.rs')
-rw-r--r-- | components/script/dom/htmlanchorelement.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index 1860f685d9a..6414c7d0c3c 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -50,19 +50,19 @@ impl HTMLAnchorElement { } trait PrivateHTMLAnchorElementHelpers { - fn handle_event_impl(&self, event: JSRef<Event>); + fn handle_event_impl(self, event: JSRef<Event>); } impl<'a> PrivateHTMLAnchorElementHelpers for JSRef<'a, HTMLAnchorElement> { - fn handle_event_impl(&self, event: JSRef<Event>) { + fn handle_event_impl(self, event: JSRef<Event>) { if "click" == event.Type().as_slice() && !event.DefaultPrevented() { - let element: JSRef<Element> = ElementCast::from_ref(*self); + let element: JSRef<Element> = ElementCast::from_ref(self); let attr = element.get_attribute(Null, "href").root(); match attr { Some(ref href) => { let value = href.Value(); debug!("clicked on link to {:s}", value); - let node: JSRef<Node> = NodeCast::from_ref(*self); + let node: JSRef<Node> = NodeCast::from_ref(self); let doc = node.owner_doc().root(); doc.load_anchor_href(value); } @@ -122,13 +122,13 @@ impl Reflectable for HTMLAnchorElement { } impl<'a> HTMLAnchorElementMethods for JSRef<'a, HTMLAnchorElement> { - fn Text(&self) -> DOMString { - let node: JSRef<Node> = NodeCast::from_ref(*self); + fn Text(self) -> DOMString { + let node: JSRef<Node> = NodeCast::from_ref(self); node.GetTextContent().unwrap() } - fn SetText(&self, value: DOMString) { - let node: JSRef<Node> = NodeCast::from_ref(*self); + fn SetText(self, value: DOMString) { + let node: JSRef<Node> = NodeCast::from_ref(self); node.SetTextContent(Some(value)) } } |