mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Implement ParentNode.children for Document and Element
Also implement it for DocumentFragment
This commit is contained in:
parent
e332f2f0fe
commit
4c057deaf9
9 changed files with 67 additions and 5 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue