mirror of
https://github.com/servo/servo.git
synced 2025-10-08 12:39:30 +01:00
Implement querySelector for Document
This commit is contained in:
parent
f0aadb790d
commit
249c484c24
5 changed files with 38 additions and 5 deletions
|
@ -12,7 +12,8 @@ use dom::bindings::js::{JS, JSRef, Temporary, OptionalSettable, TemporaryPushabl
|
|||
use dom::bindings::js::OptionalRootable;
|
||||
use dom::bindings::trace::Untraceable;
|
||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::bindings::error::{ErrorResult, Fallible, NotSupported, InvalidCharacter, HierarchyRequest, NamespaceError};
|
||||
use dom::bindings::error::{ErrorResult, Fallible, NotSupported, InvalidCharacter};
|
||||
use dom::bindings::error::{HierarchyRequest, NamespaceError};
|
||||
use dom::bindings::utils::{xml_name_type, InvalidXMLName, Name, QName};
|
||||
use dom::comment::Comment;
|
||||
use dom::customevent::CustomEvent;
|
||||
|
@ -806,13 +807,16 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
|||
window.Location()
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-parentnode-children
|
||||
fn Children(&self) -> Temporary<HTMLCollection> {
|
||||
let window = self.window.root();
|
||||
HTMLCollection::children(&*window, NodeCast::from_ref(self))
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-parentnode-queryselector
|
||||
fn QuerySelector(&self, selectors: DOMString) -> Fallible<Option<Temporary<Element>>> {
|
||||
Ok(None)
|
||||
let root: &JSRef<Node> = NodeCast::from_ref(self);
|
||||
root.query_selector(selectors)
|
||||
}
|
||||
|
||||
fn GetOnload(&self) -> Option<EventHandlerNonNull> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue