aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-11-07 12:11:50 +0100
committerMs2ger <ms2ger@gmail.com>2014-11-07 12:11:50 +0100
commit52ef7f7948a2b34cdc71096fca0287b5ce38042a (patch)
tree670a190412da5d44bb64c8cd54b5aa5d95b68366 /components/script/dom
parentbfa1ab816fb5f7fe0056e4ce77a8dc40826d876b (diff)
downloadservo-52ef7f7948a2b34cdc71096fca0287b5ce38042a.tar.gz
servo-52ef7f7948a2b34cdc71096fca0287b5ce38042a.zip
Document bindings/trace.rs.
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/bindings/trace.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index c4f59491c57..94d05e4c477 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#![deny(missing_doc)]
+
//! Utilities for tracing JS-managed values.
//!
//! The lifetime of DOM objects is managed by the SpiderMonkey Garbage
@@ -58,6 +60,12 @@ use dom::node::{Node, TrustedNodeAddress};
use dom::bindings::utils::WindowProxyHandler;
use html5ever::tree_builder::QuirksMode;
+/// A trait to allow tracing (only) DOM objects.
+pub trait JSTraceable {
+ /// Trace `self`.
+ fn trace(&self, trc: *mut JSTracer);
+}
+
impl<T: Reflectable> JSTraceable for JS<T> {
fn trace(&self, trc: *mut JSTracer) {
trace_reflector(trc, "", self.reflector());
@@ -66,11 +74,6 @@ impl<T: Reflectable> JSTraceable for JS<T> {
no_jsmanaged_fields!(Reflector)
-/// A trait to allow tracing (only) DOM objects.
-pub trait JSTraceable {
- fn trace(&self, trc: *mut JSTracer);
-}
-
/// Trace a `JSVal`.
pub fn trace_jsval(tracer: *mut JSTracer, description: &str, val: JSVal) {
if !val.is_markable() {