diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2014-08-07 19:12:04 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2014-08-07 19:12:04 +0100 |
commit | 8b3c9f64016fe05048f8d774dc7bf0b842bdbd9c (patch) | |
tree | 6b518feee941568ef884b1765c0bfe7ab472f787 /src/components/script/dom/nodeiterator.rs | |
parent | 1e3dc0341b48f3d6d81cc098c57a1aff6e17dfe5 (diff) | |
parent | bf85cdf0eb734513155af38663393fe7fcc03e83 (diff) | |
download | servo-8b3c9f64016fe05048f8d774dc7bf0b842bdbd9c.tar.gz servo-8b3c9f64016fe05048f8d774dc7bf0b842bdbd9c.zip |
Merge pull request #2987 from saneyuki/idl
Add some blobs for DOM Bindings
Diffstat (limited to 'src/components/script/dom/nodeiterator.rs')
-rw-r--r-- | src/components/script/dom/nodeiterator.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/components/script/dom/nodeiterator.rs b/src/components/script/dom/nodeiterator.rs new file mode 100644 index 00000000000..f890f71cf4f --- /dev/null +++ b/src/components/script/dom/nodeiterator.rs @@ -0,0 +1,35 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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/. */ + +use dom::bindings::codegen::Bindings::NodeIteratorBinding; +use dom::bindings::codegen::Bindings::NodeIteratorBinding::NodeIteratorMethods; +use dom::bindings::global::GlobalRef; +use dom::bindings::js::{JSRef, Temporary}; +use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; + +#[deriving(Encodable)] +pub struct NodeIterator { + pub reflector_: Reflector +} + +impl NodeIterator { + pub fn new_inherited() -> NodeIterator { + NodeIterator { + reflector_: Reflector::new() + } + } + + pub fn new(global: &GlobalRef) -> Temporary<NodeIterator> { + reflect_dom_object(box NodeIterator::new_inherited(), global, NodeIteratorBinding::Wrap) + } +} + +impl<'a> NodeIteratorMethods for JSRef<'a, NodeIterator> { +} + +impl Reflectable for NodeIterator { + fn reflector<'a>(&'a self) -> &'a Reflector { + &self.reflector_ + } +} |