mirror of
https://github.com/servo/servo.git
synced 2025-10-07 12:09:23 +01:00
auto merge of #2632 : brunoabinader/servo/document-queryselectorall, r=Ms2ger
Spec: http://dom.spec.whatwg.org/#dom-parentnode-queryselectorall Closes #851.
This commit is contained in:
commit
baa97fe6e5
6 changed files with 116 additions and 3 deletions
|
@ -330,6 +330,7 @@ pub trait DocumentMethods {
|
|||
fn Location(&self) -> Temporary<Location>;
|
||||
fn Children(&self) -> Temporary<HTMLCollection>;
|
||||
fn QuerySelector(&self, selectors: DOMString) -> Fallible<Option<Temporary<Element>>>;
|
||||
fn QuerySelectorAll(&self, selectors: DOMString) -> Fallible<Temporary<NodeList>>;
|
||||
fn GetOnclick(&self) -> Option<EventHandlerNonNull>;
|
||||
fn SetOnclick(&self, listener: Option<EventHandlerNonNull>);
|
||||
fn GetOnload(&self) -> Option<EventHandlerNonNull>;
|
||||
|
@ -821,6 +822,12 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
|||
root.query_selector(selectors)
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-parentnode-queryselectorall
|
||||
fn QuerySelectorAll(&self, selectors: DOMString) -> Fallible<Temporary<NodeList>> {
|
||||
let root: &JSRef<Node> = NodeCast::from_ref(self);
|
||||
root.query_selector_all(selectors)
|
||||
}
|
||||
|
||||
fn GetOnclick(&self) -> Option<EventHandlerNonNull> {
|
||||
let eventtarget: &JSRef<EventTarget> = EventTargetCast::from_ref(self);
|
||||
eventtarget.get_event_handler_common("click")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue