mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Make the traits for the IDL interfaces take &self
This commit is contained in:
parent
856fda7f2e
commit
709d347872
99 changed files with 1192 additions and 1192 deletions
|
@ -51,46 +51,46 @@ impl DocumentFragment {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> DocumentFragmentMethods for &'a DocumentFragment {
|
||||
impl DocumentFragmentMethods for DocumentFragment {
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-children
|
||||
fn Children(self) -> Root<HTMLCollection> {
|
||||
fn Children(&self) -> Root<HTMLCollection> {
|
||||
let window = window_from_node(self);
|
||||
HTMLCollection::children(window.r(), NodeCast::from_ref(self))
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-firstelementchild
|
||||
fn GetFirstElementChild(self) -> Option<Root<Element>> {
|
||||
fn GetFirstElementChild(&self) -> Option<Root<Element>> {
|
||||
NodeCast::from_ref(self).child_elements().next()
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-lastelementchild
|
||||
fn GetLastElementChild(self) -> Option<Root<Element>> {
|
||||
fn GetLastElementChild(&self) -> Option<Root<Element>> {
|
||||
NodeCast::from_ref(self).rev_children().filter_map(ElementCast::to_root).next()
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-childelementcount
|
||||
fn ChildElementCount(self) -> u32 {
|
||||
fn ChildElementCount(&self) -> u32 {
|
||||
NodeCast::from_ref(self).child_elements().count() as u32
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-prepend
|
||||
fn Prepend(self, nodes: Vec<NodeOrString>) -> ErrorResult {
|
||||
fn Prepend(&self, nodes: Vec<NodeOrString>) -> ErrorResult {
|
||||
NodeCast::from_ref(self).prepend(nodes)
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-append
|
||||
fn Append(self, nodes: Vec<NodeOrString>) -> ErrorResult {
|
||||
fn Append(&self, nodes: Vec<NodeOrString>) -> ErrorResult {
|
||||
NodeCast::from_ref(self).append(nodes)
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-queryselector
|
||||
fn QuerySelector(self, selectors: DOMString) -> Fallible<Option<Root<Element>>> {
|
||||
fn QuerySelector(&self, selectors: DOMString) -> Fallible<Option<Root<Element>>> {
|
||||
let root = NodeCast::from_ref(self);
|
||||
root.query_selector(selectors)
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-queryselectorall
|
||||
fn QuerySelectorAll(self, selectors: DOMString) -> Fallible<Root<NodeList>> {
|
||||
fn QuerySelectorAll(&self, selectors: DOMString) -> Fallible<Root<NodeList>> {
|
||||
let root = NodeCast::from_ref(self);
|
||||
root.query_selector_all(selectors)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue