pub fn traverse_depth_first(&self, mut f: impl FnMut(&Node<S>)) {
        fn inner<S: State>(dom: &RealDom<S>, id: ElementId, f: &mut impl FnMut(&Node<S>)) {
            let node = &dom[id];
            f(node);
            if let NodeType::Element { children, .. } = &node.node_type {
                for c in children {
                    inner(dom, *c, f);
                }
            }
        }
        if let NodeType::Element { children, .. } = &self[self.root].node_type {
            for c in children {
                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(&self, mut f: impl FnMut(&Node<S>)) {
        fn inner<S: State>(dom: &RealDom<S>, id: ElementId, f: &mut impl FnMut(&Node<S>)) {
            let node = &dom[id];
            f(node);
            if let NodeType::Element { children, .. } = &node.node_type {
                for c in children {
                    inner(dom, *c, f);
                }
            }
        }
        if let NodeType::Element { children, .. } = &self[self.root].node_type {
            for c in children {
                inner(self, *c, &mut f);
            }
        }
    }
pub fn traverse_depth_first ( & self , mut f : impl FnMut ( & Node < S > ) ) { fn inner < S : State > ( dom : & RealDom < S > , id : ElementId , f : & mut impl FnMut ( & Node < S > ) ) { let node = & dom [ id ] ; f ( node ) ; if let NodeType :: Element { children , .. } = & node . node_type { for c in children { inner ( dom , * c , f ) ; } } } if let NodeType :: Element { children , .. } = & self [ self . root ] . node_type { for c in children { 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 .
&self
f
impl FnMut(&Node<S>)
&self
f
impl FnMut(&Node<S>)