Added ParentNode.querySelector skeleton

This commit is contained in:
Bruno de Oliveira Abinader 2014-06-03 14:16:49 -07:00
parent f78d04b620
commit f0aadb790d
4 changed files with 23 additions and 0 deletions

View file

@ -7,10 +7,12 @@ use dom::bindings::codegen::Bindings::DocumentFragmentBinding;
use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::error::Fallible;
use dom::document::Document;
use dom::element::Element;
use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::htmlcollection::HTMLCollection;
use dom::node::{DocumentFragmentNodeTypeId, Node, window_from_node};
use dom::window::{Window, WindowMethods};
use servo_util::str::DOMString;
#[deriving(Encodable)]
pub struct DocumentFragment {
@ -46,6 +48,7 @@ impl DocumentFragment {
pub trait DocumentFragmentMethods {
fn Children(&self) -> Temporary<HTMLCollection>;
fn QuerySelector(&self, selectors: DOMString) -> Fallible<Option<Temporary<Element>>>;
}
impl<'a> DocumentFragmentMethods for JSRef<'a, DocumentFragment> {
@ -53,4 +56,8 @@ impl<'a> DocumentFragmentMethods for JSRef<'a, DocumentFragment> {
let window = window_from_node(self).root();
HTMLCollection::children(&window.root_ref(), NodeCast::from_ref(self))
}
fn QuerySelector(&self, selectors: DOMString) -> Fallible<Option<Temporary<Element>>> {
Ok(None)
}
}