diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-02-10 04:33:45 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-02-10 04:33:45 -0700 |
commit | 2c5155a119872ccdfb614c4cd5b1379de20ab595 (patch) | |
tree | 2090437abe955c85e9e8a959c978b170017e6a2d /components/script/dom/mod.rs | |
parent | 29d3b872de4abb693b75e71fc0b987c52b0fd1f6 (diff) | |
parent | 65005443872b46d8d27ece75ee43b2ac1e799fb2 (diff) | |
download | servo-2c5155a119872ccdfb614c4cd5b1379de20ab595.tar.gz servo-2c5155a119872ccdfb614c4cd5b1379de20ab595.zip |
auto merge of #4878 : saneyuki/servo/doc, r=Ms2ger
Now, we have many documents about dom bindings as inline comments. It's better to fuse a standalone markdown document to them.
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 f53ef704e48..d5446e525b4 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 |