pub fn remove_node(&mut self, mc: MutationContext<'gc, '_>) {
        if let Some(parent) = self.parent() {
            // This is guaranteed to succeed, as `self` is a child of `parent`.
            let position = parent.child_position(*self).unwrap();

            match &mut *parent.0.write(mc) {
                XmlNodeData::DocumentRoot { children, .. }
                | XmlNodeData::Element { children, .. } => children.remove(position),
                XmlNodeData::Text { .. } => {
                    // This cannot happen, as `insert_child` refuses to adopt children into text nodes.
                    unreachable!();
                }
            };

            self.disown_siblings(mc);
            self.disown_parent(mc);
        }
    }
/// Remove this node from its parent.
Remove this node from its parent.
Remove this node from its parent .
pub fn remove_node(&mut self, mc: MutationContext<'gc, '_>) {
        if let Some(parent) = self.parent() {
            // This is guaranteed to succeed, as `self` is a child of `parent`.
            let position = parent.child_position(*self).unwrap();
            match &mut *parent.0.write(mc) {
                XmlNodeData::DocumentRoot { children, .. }
                | XmlNodeData::Element { children, .. } => children.remove(position),
                XmlNodeData::Text { .. } => {
                    // This cannot happen, as `insert_child` refuses to adopt children into text nodes.
                    unreachable!();
                }
            };
            self.disown_siblings(mc);
            self.disown_parent(mc);
        }
    }
pub fn remove_node ( & mut self , mc : MutationContext < ' gc , ' _ > ) { if let Some ( parent ) = self . parent ( ) { // This is guaranteed to succeed, as `self` is a child of `parent`. let position = parent . child_position ( * self ) . unwrap ( ) ; match & mut * parent . 0 . write ( mc ) { XmlNodeData :: DocumentRoot { children , .. } | XmlNodeData :: Element { children , .. } => children . remove ( position ) , XmlNodeData :: Text { .. } => { // This cannot happen, as `insert_child` refuses to adopt children into text nodes. unreachable ! ( ) ; } } ; self . disown_siblings ( mc ) ; self . disown_parent ( mc ) ; } }
Remove this node from its parent.
Remove this node from its parent .
&mut self
mc
MutationContext<'gc, '_>