aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/script/dom/bindings/root.rs20
-rw-r--r--components/script/dom/mod.rs2
-rw-r--r--components/script/dom/nodeiterator.rs6
-rw-r--r--components/script/dom/range.rs6
-rw-r--r--components/script/dom/touch.rs6
-rw-r--r--components/script/dom/touchevent.rs14
-rw-r--r--components/script/dom/treewalker.rs6
-rw-r--r--components/script/dom/vrdisplay.rs14
8 files changed, 37 insertions, 37 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
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs
index 8020d832ab9..7c683edf9eb 100644
--- a/components/script/dom/mod.rs
+++ b/components/script/dom/mod.rs
@@ -33,7 +33,7 @@
//! the [`Root`](bindings/root/struct.Root.html) smart pointer;
//! * tracing pointers in member fields: the [`Dom`](bindings/root/struct.Dom.html),
//! [`MutNullableJS`](bindings/root/struct.MutNullableJS.html) and
-//! [`MutJS`](bindings/root/struct.MutJS.html) smart pointers and
+//! [`MutDom`](bindings/root/struct.MutDom.html) smart pointers and
//! [the tracing implementation](bindings/trace/index.html);
//! * rooting pointers from across thread boundaries or in channels: the
//! [`Trusted`](bindings/refcounted/struct.Trusted.html) smart pointer;
diff --git a/components/script/dom/nodeiterator.rs b/components/script/dom/nodeiterator.rs
index 0ab8c54360b..ec18066a978 100644
--- a/components/script/dom/nodeiterator.rs
+++ b/components/script/dom/nodeiterator.rs
@@ -10,7 +10,7 @@ use dom::bindings::codegen::Bindings::NodeIteratorBinding;
use dom::bindings::codegen::Bindings::NodeIteratorBinding::NodeIteratorMethods;
use dom::bindings::error::Fallible;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
-use dom::bindings::root::{Dom, MutJS, Root};
+use dom::bindings::root::{Dom, MutDom, Root};
use dom::document::Document;
use dom::node::Node;
use dom_struct::dom_struct;
@@ -22,7 +22,7 @@ pub struct NodeIterator {
reflector_: Reflector,
root_node: Dom<Node>,
#[ignore_heap_size_of = "Defined in rust-mozjs"]
- reference_node: MutJS<Node>,
+ reference_node: MutDom<Node>,
pointer_before_reference_node: Cell<bool>,
what_to_show: u32,
#[ignore_heap_size_of = "Can't measure due to #6870"]
@@ -36,7 +36,7 @@ impl NodeIterator {
NodeIterator {
reflector_: Reflector::new(),
root_node: Dom::from_ref(root_node),
- reference_node: MutJS::new(root_node),
+ reference_node: MutDom::new(root_node),
pointer_before_reference_node: Cell::new(true),
what_to_show: what_to_show,
filter: filter
diff --git a/components/script/dom/range.rs b/components/script/dom/range.rs
index 1344f9c7a5c..79091beff55 100644
--- a/components/script/dom/range.rs
+++ b/components/script/dom/range.rs
@@ -14,7 +14,7 @@ use dom::bindings::error::{Error, ErrorResult, Fallible};
use dom::bindings::inheritance::{CharacterDataTypeId, NodeTypeId};
use dom::bindings::inheritance::Castable;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
-use dom::bindings::root::{Dom, MutJS, Root, RootedReference};
+use dom::bindings::root::{Dom, MutDom, Root, RootedReference};
use dom::bindings::str::DOMString;
use dom::bindings::trace::JSTraceable;
use dom::bindings::weakref::{WeakRef, WeakRefVec};
@@ -933,7 +933,7 @@ impl RangeMethods for Range {
#[derive(DenyPublicFields, HeapSizeOf, JSTraceable)]
#[must_root]
pub struct BoundaryPoint {
- node: MutJS<Node>,
+ node: MutDom<Node>,
offset: Cell<u32>,
}
@@ -942,7 +942,7 @@ impl BoundaryPoint {
debug_assert!(!node.is_doctype());
debug_assert!(offset <= node.len());
BoundaryPoint {
- node: MutJS::new(node),
+ node: MutDom::new(node),
offset: Cell::new(offset),
}
}
diff --git a/components/script/dom/touch.rs b/components/script/dom/touch.rs
index d7920a2dd19..d526e607d8d 100644
--- a/components/script/dom/touch.rs
+++ b/components/script/dom/touch.rs
@@ -6,7 +6,7 @@ use dom::bindings::codegen::Bindings::TouchBinding;
use dom::bindings::codegen::Bindings::TouchBinding::TouchMethods;
use dom::bindings::num::Finite;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
-use dom::bindings::root::{MutJS, Root};
+use dom::bindings::root::{MutDom, Root};
use dom::eventtarget::EventTarget;
use dom::window::Window;
use dom_struct::dom_struct;
@@ -15,7 +15,7 @@ use dom_struct::dom_struct;
pub struct Touch {
reflector_: Reflector,
identifier: i32,
- target: MutJS<EventTarget>,
+ target: MutDom<EventTarget>,
screen_x: f64,
screen_y: f64,
client_x: f64,
@@ -32,7 +32,7 @@ impl Touch {
Touch {
reflector_: Reflector::new(),
identifier: identifier,
- target: MutJS::new(target),
+ target: MutDom::new(target),
screen_x: *screen_x,
screen_y: *screen_y,
client_x: *client_x,
diff --git a/components/script/dom/touchevent.rs b/components/script/dom/touchevent.rs
index 4c29bc48445..92ff9bf0424 100644
--- a/components/script/dom/touchevent.rs
+++ b/components/script/dom/touchevent.rs
@@ -7,7 +7,7 @@ use dom::bindings::codegen::Bindings::TouchEventBinding::TouchEventMethods;
use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods;
use dom::bindings::inheritance::Castable;
use dom::bindings::reflector::reflect_dom_object;
-use dom::bindings::root::{MutJS, Root};
+use dom::bindings::root::{MutDom, Root};
use dom::bindings::str::DOMString;
use dom::event::{EventBubbles, EventCancelable};
use dom::touchlist::TouchList;
@@ -19,9 +19,9 @@ use std::cell::Cell;
#[dom_struct]
pub struct TouchEvent {
uievent: UIEvent,
- touches: MutJS<TouchList>,
- target_touches: MutJS<TouchList>,
- changed_touches: MutJS<TouchList>,
+ touches: MutDom<TouchList>,
+ target_touches: MutDom<TouchList>,
+ changed_touches: MutDom<TouchList>,
alt_key: Cell<bool>,
meta_key: Cell<bool>,
ctrl_key: Cell<bool>,
@@ -34,9 +34,9 @@ impl TouchEvent {
target_touches: &TouchList) -> TouchEvent {
TouchEvent {
uievent: UIEvent::new_inherited(),
- touches: MutJS::new(touches),
- target_touches: MutJS::new(target_touches),
- changed_touches: MutJS::new(changed_touches),
+ touches: MutDom::new(touches),
+ target_touches: MutDom::new(target_touches),
+ changed_touches: MutDom::new(changed_touches),
ctrl_key: Cell::new(false),
shift_key: Cell::new(false),
alt_key: Cell::new(false),
diff --git a/components/script/dom/treewalker.rs b/components/script/dom/treewalker.rs
index bbb27c61541..61a085aaa53 100644
--- a/components/script/dom/treewalker.rs
+++ b/components/script/dom/treewalker.rs
@@ -10,7 +10,7 @@ use dom::bindings::codegen::Bindings::TreeWalkerBinding;
use dom::bindings::codegen::Bindings::TreeWalkerBinding::TreeWalkerMethods;
use dom::bindings::error::Fallible;
use dom::bindings::reflector::{Reflector, reflect_dom_object};
-use dom::bindings::root::{Dom, MutJS, Root};
+use dom::bindings::root::{Dom, MutDom, Root};
use dom::document::Document;
use dom::node::Node;
use dom_struct::dom_struct;
@@ -21,7 +21,7 @@ use std::rc::Rc;
pub struct TreeWalker {
reflector_: Reflector,
root_node: Dom<Node>,
- current_node: MutJS<Node>,
+ current_node: MutDom<Node>,
what_to_show: u32,
#[ignore_heap_size_of = "function pointers and Rc<T> are hard"]
filter: Filter
@@ -34,7 +34,7 @@ impl TreeWalker {
TreeWalker {
reflector_: Reflector::new(),
root_node: Dom::from_ref(root_node),
- current_node: MutJS::new(root_node),
+ current_node: MutDom::new(root_node),
what_to_show: what_to_show,
filter: filter
}
diff --git a/components/script/dom/vrdisplay.rs b/components/script/dom/vrdisplay.rs
index a17666e625e..d6e8d480c3d 100644
--- a/components/script/dom/vrdisplay.rs
+++ b/components/script/dom/vrdisplay.rs
@@ -18,7 +18,7 @@ use dom::bindings::inheritance::Castable;
use dom::bindings::num::Finite;
use dom::bindings::refcounted::Trusted;
use dom::bindings::reflector::{DomObject, reflect_dom_object};
-use dom::bindings::root::{MutJS, MutNullableJS, Root};
+use dom::bindings::root::{MutDom, MutNullableJS, Root};
use dom::bindings::str::DOMString;
use dom::event::Event;
use dom::eventtarget::EventTarget;
@@ -51,9 +51,9 @@ pub struct VRDisplay {
depth_near: Cell<f64>,
depth_far: Cell<f64>,
presenting: Cell<bool>,
- left_eye_params: MutJS<VREyeParameters>,
- right_eye_params: MutJS<VREyeParameters>,
- capabilities: MutJS<VRDisplayCapabilities>,
+ left_eye_params: MutDom<VREyeParameters>,
+ right_eye_params: MutDom<VREyeParameters>,
+ capabilities: MutDom<VRDisplayCapabilities>,
stage_params: MutNullableJS<VRStageParameters>,
#[ignore_heap_size_of = "Defined in rust-webvr"]
frame_data: DOMRefCell<WebVRFrameData>,
@@ -100,9 +100,9 @@ impl VRDisplay {
depth_near: Cell::new(0.01),
depth_far: Cell::new(10000.0),
presenting: Cell::new(false),
- left_eye_params: MutJS::new(&*VREyeParameters::new(display.left_eye_parameters.clone(), &global)),
- right_eye_params: MutJS::new(&*VREyeParameters::new(display.right_eye_parameters.clone(), &global)),
- capabilities: MutJS::new(&*VRDisplayCapabilities::new(display.capabilities.clone(), &global)),
+ left_eye_params: MutDom::new(&*VREyeParameters::new(display.left_eye_parameters.clone(), &global)),
+ right_eye_params: MutDom::new(&*VREyeParameters::new(display.right_eye_parameters.clone(), &global)),
+ capabilities: MutDom::new(&*VRDisplayCapabilities::new(display.capabilities.clone(), &global)),
stage_params: MutNullableJS::new(stage.as_ref().map(|v| v.deref())),
frame_data: DOMRefCell::new(Default::default()),
layer: DOMRefCell::new(Default::default()),