aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/documentfragment.rs
diff options
context:
space:
mode:
authorTom Schuster <evilpies@gmail.com>2014-04-19 22:23:13 +0200
committerTom Schuster <evilpies@gmail.com>2014-04-22 22:19:52 +0200
commit4c057deaf9e90aa4e27056d331419611384e8427 (patch)
tree0398a6961328ce29616ef6f12e8b30b724a49557 /src/components/script/dom/documentfragment.rs
parente332f2f0fec23b2318589b08c2a1e8fb1557e672 (diff)
downloadservo-4c057deaf9e90aa4e27056d331419611384e8427.tar.gz
servo-4c057deaf9e90aa4e27056d331419611384e8427.zip
Implement ParentNode.children for Document and Element
Also implement it for DocumentFragment
Diffstat (limited to 'src/components/script/dom/documentfragment.rs')
-rw-r--r--src/components/script/dom/documentfragment.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/components/script/dom/documentfragment.rs b/src/components/script/dom/documentfragment.rs
index 13fe9b9c80e..bd9afa7d97f 100644
--- a/src/components/script/dom/documentfragment.rs
+++ b/src/components/script/dom/documentfragment.rs
@@ -2,12 +2,13 @@
* 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::InheritTypes::DocumentFragmentDerived;
+use dom::bindings::codegen::InheritTypes::{DocumentFragmentDerived, NodeCast};
use dom::bindings::codegen::DocumentFragmentBinding;
use dom::bindings::js::JS;
use dom::bindings::error::Fallible;
use dom::document::Document;
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
+use dom::htmlcollection::HTMLCollection;
use dom::node::{DocumentFragmentNodeTypeId, Node};
use dom::window::Window;
@@ -44,3 +45,11 @@ impl DocumentFragment {
Ok(DocumentFragment::new(&owner.get().Document()))
}
}
+
+impl DocumentFragment {
+ pub fn Children(&self, abstract_self: &JS<DocumentFragment>) -> JS<HTMLCollection> {
+ let doc = self.node.owner_doc();
+ let doc = doc.get();
+ HTMLCollection::children(&doc.window, &NodeCast::from(abstract_self))
+ }
+}