diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-26 00:16:22 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-09-26 09:49:00 +0200 |
commit | d29335040d78a19f25830061484cf70dc03a9c21 (patch) | |
tree | bac565ff8784a124a385632a3b0680c326510d93 /components/script/dom/bindings/root.rs | |
parent | 7be32fb2371a14ba61b008a37e79761f66c073c7 (diff) | |
download | servo-d29335040d78a19f25830061484cf70dc03a9c21.tar.gz servo-d29335040d78a19f25830061484cf70dc03a9c21.zip |
Rename MutJS<T> to MutDom<T>
Diffstat (limited to 'components/script/dom/bindings/root.rs')
-rw-r--r-- | components/script/dom/bindings/root.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/components/script/dom/bindings/root.rs b/components/script/dom/bindings/root.rs index 32c3e5c7eaa..a7f4bb9e411 100644 --- a/components/script/dom/bindings/root.rs +++ b/components/script/dom/bindings/root.rs @@ -237,20 +237,20 @@ impl LayoutJS<Node> { /// on `Dom<T>`. #[must_root] #[derive(JSTraceable)] -pub struct MutJS<T: DomObject> { +pub struct MutDom<T: DomObject> { val: UnsafeCell<Dom<T>>, } -impl<T: DomObject> MutJS<T> { - /// Create a new `MutJS`. - pub fn new(initial: &T) -> MutJS<T> { +impl<T: DomObject> MutDom<T> { + /// Create a new `MutDom`. + pub fn new(initial: &T) -> MutDom<T> { debug_assert!(thread_state::get().is_script()); - MutJS { + MutDom { val: UnsafeCell::new(Dom::from_ref(initial)), } } - /// Set this `MutJS` to the given value. + /// Set this `MutDom` to the given value. pub fn set(&self, val: &T) { debug_assert!(thread_state::get().is_script()); unsafe { @@ -258,7 +258,7 @@ impl<T: DomObject> MutJS<T> { } } - /// Get the value in this `MutJS`. + /// Get the value in this `MutDom`. pub fn get(&self) -> Root<T> { debug_assert!(thread_state::get().is_script()); unsafe { @@ -267,14 +267,14 @@ impl<T: DomObject> MutJS<T> { } } -impl<T: DomObject> HeapSizeOf for MutJS<T> { +impl<T: DomObject> HeapSizeOf for MutDom<T> { fn heap_size_of_children(&self) -> usize { // See comment on HeapSizeOf for Dom<T>. 0 } } -impl<T: DomObject> PartialEq for MutJS<T> { +impl<T: DomObject> PartialEq for MutDom<T> { fn eq(&self, other: &Self) -> bool { unsafe { *self.val.get() == *other.val.get() @@ -282,7 +282,7 @@ impl<T: DomObject> PartialEq for MutJS<T> { } } -impl<T: DomObject + PartialEq> PartialEq<T> for MutJS<T> { +impl<T: DomObject + PartialEq> PartialEq<T> for MutDom<T> { fn eq(&self, other: &T) -> bool { unsafe { **self.val.get() == *other |