mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Implement NonDocumentTypeChildNode::*ElementSibling()
This commit is contained in:
parent
f8d0237956
commit
3d68a46fee
12 changed files with 44 additions and 141 deletions
|
@ -1178,6 +1178,18 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-previouselementsibling
|
||||
fn GetPreviousElementSibling(self) -> Option<Temporary<Element>> {
|
||||
NodeCast::from_ref(self).preceding_siblings()
|
||||
.filter_map(ElementCast::to_temporary).next()
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-nondocumenttypechildnode-nextelementsibling
|
||||
fn GetNextElementSibling(self) -> Option<Temporary<Element>> {
|
||||
NodeCast::from_ref(self).following_siblings()
|
||||
.filter_map(ElementCast::to_temporary).next()
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-parentnode-children
|
||||
fn Children(self) -> Temporary<HTMLCollection> {
|
||||
let window = window_from_node(self).root();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue