Implement ParentNode#replaceChildren

This commit is contained in:
Vincent Ricard 2020-09-24 19:01:59 +02:00
parent 0baa1ea7bd
commit 66f80fbf4f
7 changed files with 29 additions and 100 deletions

View file

@ -100,6 +100,11 @@ impl DocumentFragmentMethods for DocumentFragment {
self.upcast::<Node>().append(nodes)
}
// https://dom.spec.whatwg.org/#dom-parentnode-replacechildren
fn ReplaceChildren(&self, nodes: Vec<NodeOrString>) -> ErrorResult {
self.upcast::<Node>().replace_children(nodes)
}
// https://dom.spec.whatwg.org/#dom-parentnode-queryselector
fn QuerySelector(&self, selectors: DOMString) -> Fallible<Option<DomRoot<Element>>> {
self.upcast::<Node>().query_selector(selectors)