diff options
author | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2015-02-10 03:35:24 +0900 |
---|---|---|
committer | Tetsuharu OHZEKI <saneyuki.snyk@gmail.com> | 2015-02-10 20:13:37 +0900 |
commit | 65005443872b46d8d27ece75ee43b2ac1e799fb2 (patch) | |
tree | 0478c770f5295b4bfbe5cd2ba24ad430f221f939 /components/script/dom/mod.rs | |
parent | 83a6b5d7705facb9c3fe56d8adeffb2e136231e8 (diff) | |
download | servo-65005443872b46d8d27ece75ee43b2ac1e799fb2.tar.gz servo-65005443872b46d8d27ece75ee43b2ac1e799fb2.zip |
[script] Merge the binding design document into inline doc comments.
Diffstat (limited to 'components/script/dom/mod.rs')
-rw-r--r-- | components/script/dom/mod.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index 0650a900494..6a9b4827e96 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -67,10 +67,10 @@ //! (The result of either method can be wrapped in `Result`, if that is //! appropriate for the type in question.) //! -//! The latter calls the former, boxes the result, and creates a reflector for -//! it by calling `dom::bindings::utils::reflect_dom_object` (which yields -//! ownership of the object to the SpiderMonkey Garbage Collector). This is the -//! API to use when creating a DOM object. +//! The latter calls the former, boxes the result, and creates a reflector +//! corresponding to it by calling `dom::bindings::utils::reflect_dom_object` +//! (which yields ownership of the object to the SpiderMonkey Garbage Collector). +//! This is the API to use when creating a DOM object. //! //! The former should only be called by the latter, and by subclasses' //! `new_inherited` methods. @@ -98,9 +98,11 @@ //! ============================= //! //! Every DOM object has a `Reflector` as its first (transitive) member field. -//! This contains a `*mut JSObject` that points to its reflector. This field -//! is initialized by the `FooBinding::Wrap` method, called from -//! `reflect_dom_object`. +//! This contains a `*mut JSObject` that points to its reflector. +//! +//! The `FooBinding::Wrap` function creates the reflector, stores a pointer to +//! the DOM object in the reflector, and initializes the pointer to the reflector +//! in the `Reflector` field. //! //! The `Reflectable` trait provides a `reflector()` method that returns the //! DOM object's `Reflector`. It is implemented automatically for DOM structs |