From d29335040d78a19f25830061484cf70dc03a9c21 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 26 Sep 2017 00:16:22 +0200 Subject: Rename MutJS to MutDom --- components/script/dom/bindings/root.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'components/script/dom/bindings/root.rs') 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 { /// on `Dom`. #[must_root] #[derive(JSTraceable)] -pub struct MutJS { +pub struct MutDom { val: UnsafeCell>, } -impl MutJS { - /// Create a new `MutJS`. - pub fn new(initial: &T) -> MutJS { +impl MutDom { + /// Create a new `MutDom`. + pub fn new(initial: &T) -> MutDom { 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 MutJS { } } - /// Get the value in this `MutJS`. + /// Get the value in this `MutDom`. pub fn get(&self) -> Root { debug_assert!(thread_state::get().is_script()); unsafe { @@ -267,14 +267,14 @@ impl MutJS { } } -impl HeapSizeOf for MutJS { +impl HeapSizeOf for MutDom { fn heap_size_of_children(&self) -> usize { // See comment on HeapSizeOf for Dom. 0 } } -impl PartialEq for MutJS { +impl PartialEq for MutDom { fn eq(&self, other: &Self) -> bool { unsafe { *self.val.get() == *other.val.get() @@ -282,7 +282,7 @@ impl PartialEq for MutJS { } } -impl PartialEq for MutJS { +impl PartialEq for MutDom { fn eq(&self, other: &T) -> bool { unsafe { **self.val.get() == *other -- cgit v1.2.3