mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Implement ChildNode.remove()
This commit is contained in:
parent
325a39b8ba
commit
6f310a5c20
8 changed files with 61 additions and 7 deletions
|
@ -406,6 +406,7 @@ pub trait ElementMethods {
|
|||
fn GetInnerHTML(&self) -> Fallible<DOMString>;
|
||||
fn GetOuterHTML(&self) -> Fallible<DOMString>;
|
||||
fn Children(&self) -> Temporary<HTMLCollection>;
|
||||
fn Remove(&mut self);
|
||||
}
|
||||
|
||||
impl<'a> ElementMethods for JSRef<'a, Element> {
|
||||
|
@ -678,6 +679,12 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
|
|||
let window = window_from_node(self).root();
|
||||
HTMLCollection::children(&*window, NodeCast::from_ref(self))
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#dom-childnode-remove
|
||||
fn Remove(&mut self) {
|
||||
let node: &mut JSRef<Node> = NodeCast::from_mut_ref(self);
|
||||
node.remove_self();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_attribute_parts(name: DOMString) -> (Option<~str>, ~str) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue