You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: custom_element.rs
    path of file: ./repos/dioxus/packages/native-core/src
    
    the code of the file until where you have to start completion: //! A custom element is a controlled element that renders
    
    pub fn add_shadow_dom(&self, mut node: NodeMut<V>) {
        let element_tag = if let NodeType::Element(el) = &*node.node_type() {
            Some((el.tag.clone(), el.namespace.clone()))
        } else {
            None
        };
        if let Some((tag, ns)) = element_tag {
            if let Some(builder) = self.builders.get(&(tag.as_str(), ns.as_deref())) {
                let boxed_custom_element = { (builder.create)(node.reborrow()) };

                let shadow_roots = boxed_custom_element.roots();

                let light_id = node.id();
                node.real_dom_mut().tree_mut().create_subtree(
                    light_id,
                    shadow_roots,
                    boxed_custom_element.slot(),
                );

                let boxed_custom_element = CustomElementManager {
                    inner: Arc::new(RwLock::new(boxed_custom_element)),
                };

                node.insert(boxed_custom_element);
            }
        }
    }