diff options
author | Cameron Zwarich <zwarich@mozilla.com> | 2014-09-18 13:43:15 -0700 |
---|---|---|
committer | Cameron Zwarich <zwarich@mozilla.com> | 2014-09-19 13:39:17 -0700 |
commit | 4fa872511117eafd934cad70c7d3b8c583fb960e (patch) | |
tree | 8c75e871c896648de54c2e9aa376d30b4b98220e /components/script/dom/attr.rs | |
parent | b8f34bbc5170f78e4939b1d647f8d8498e3c2fb6 (diff) | |
download | servo-4fa872511117eafd934cad70c7d3b8c583fb960e.tar.gz servo-4fa872511117eafd934cad70c7d3b8c583fb960e.zip |
First steps of &JSRef -> JSRef conversion
Replace &JSRef with JSRef in the bulk of the generated code. This will
remove a level of indirection throughout all DOM code.
This patch doesn't change methods implemented on JSRef<T> to take `self`
rather than `&self`, and it leaves a few other uses of &JSRef, but those
changes can be made incrementally.
Diffstat (limited to 'components/script/dom/attr.rs')
-rw-r--r-- | components/script/dom/attr.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 61f520821a1..00d42d22b49 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -95,7 +95,7 @@ impl Reflectable for Attr { impl Attr { fn new_inherited(local_name: Atom, value: AttrValue, name: Atom, namespace: Namespace, - prefix: Option<DOMString>, owner: &JSRef<Element>) -> Attr { + prefix: Option<DOMString>, owner: JSRef<Element>) -> Attr { Attr { reflector_: Reflector::new(), local_name: local_name, @@ -107,11 +107,11 @@ impl Attr { } } - pub fn new(window: &JSRef<Window>, local_name: Atom, value: AttrValue, + pub fn new(window: JSRef<Window>, local_name: Atom, value: AttrValue, name: Atom, namespace: Namespace, - prefix: Option<DOMString>, owner: &JSRef<Element>) -> Temporary<Attr> { + prefix: Option<DOMString>, owner: JSRef<Element>) -> Temporary<Attr> { reflect_dom_object(box Attr::new_inherited(local_name, value, name, namespace, prefix, owner), - &Window(*window), AttrBinding::Wrap) + &Window(window), AttrBinding::Wrap) } } @@ -157,13 +157,13 @@ pub trait AttrHelpers { impl<'a> AttrHelpers for JSRef<'a, Attr> { fn set_value(&self, set_type: AttrSettingType, value: AttrValue) { let owner = self.owner.root(); - let node: &JSRef<Node> = NodeCast::from_ref(&*owner); + let node: JSRef<Node> = NodeCast::from_ref(*owner); let namespace_is_null = self.namespace == namespace::Null; match set_type { ReplacedAttr => { if namespace_is_null { - vtable_for(node).before_remove_attr( + vtable_for(&node).before_remove_attr( self.local_name(), self.value().as_slice().to_string()) } @@ -174,7 +174,7 @@ impl<'a> AttrHelpers for JSRef<'a, Attr> { *self.value.deref().borrow_mut() = value; if namespace_is_null { - vtable_for(node).after_set_attr( + vtable_for(&node).after_set_attr( self.local_name(), self.value().as_slice().to_string()) } |