pub fn traverse_depth_first_mut(&mut self, mut f: impl FnMut(&mut Node<S>)) {
        fn inner<S: State>(dom: &mut RealDom<S>, id: ElementId, f: &mut impl FnMut(&mut Node<S>)) {
            let node = &mut dom[id];
            f(node);
            if let NodeType::Element { children, .. } = &mut node.node_type {
                for c in children.clone() {
                    inner(dom, c, f);
                }
            }
        }
        let root = self.root;
        if let NodeType::Element { children, .. } = &mut self[root].node_type {
            for c in children.clone() {
                inner(self, c, &mut f);
            }
        }
    }
/// Call a function for each node in the dom, depth first.
Call a function for each node in the dom, depth first.
Call a function for each node in the dom depth first .
pub fn traverse_depth_first_mut(&mut self, mut f: impl FnMut(&mut Node<S>)) {
        fn inner<S: State>(dom: &mut RealDom<S>, id: ElementId, f: &mut impl FnMut(&mut Node<S>)) {
            let node = &mut dom[id];
            f(node);
            if let NodeType::Element { children, .. } = &mut node.node_type {
                for c in children.clone() {
                    inner(dom, c, f);
                }
            }
        }
        let root = self.root;
        if let NodeType::Element { children, .. } = &mut self[root].node_type {
            for c in children.clone() {
                inner(self, c, &mut f);
            }
        }
    }
pub fn traverse_depth_first_mut ( & mut self , mut f : impl FnMut ( & mut Node < S > ) ) { fn inner < S : State > ( dom : & mut RealDom < S > , id : ElementId , f : & mut impl FnMut ( & mut Node < S > ) ) { let node = & mut dom [ id ] ; f ( node ) ; if let NodeType :: Element { children , .. } = & mut node . node_type { for c in children . clone ( ) { inner ( dom , c , f ) ; } } } let root = self . root ; if let NodeType :: Element { children , .. } = & mut self [ root ] . node_type { for c in children . clone ( ) { inner ( self , c , & mut f ) ; } } }
Call a function for each node in the dom, depth first.
Call a function for each node in the dom depth first .
&mut self
f
impl FnMut(&mut Node<S>)
&mut self
f
impl FnMut(&mut Node<S>)