use super::NodeList;
pub struct Component {
node_list: NodeList,
}
#[allow(clippy::new_without_default)]
impl Component {
pub fn new() -> Self {
Self {
node_list: NodeList::new(),
}
}
pub fn reserve(&mut self, nodes_capacity: usize) {
if nodes_capacity > self.node_list.len() {
let more_count = nodes_capacity - self.node_list.len();
self.node_list.nodes_mut().reserve(more_count);
}
}
pub fn node_list_mut(&mut self) -> &mut NodeList {
&mut self.node_list
}
pub(crate) fn remove_and_get_next_sibling(
&mut self,
real_parent: &web_sys::Node,
) -> Option<web_sys::Node> {
self.node_list.remove_and_get_next_sibling(real_parent)
}
pub(crate) fn remove_real_node(&mut self, real_parent: &web_sys::Node) {
self.node_list.remove_real_node(real_parent)
}
pub fn get_next_sibling(&self) -> Option<web_sys::Node> {
self.node_list.get_next_sibling()
}
pub fn get_first_real_node(&self) -> Option<&web_sys::Node> {
self.node_list.get_first_real_node()
}
pub(super) fn clone(&self, real_parent: &web_sys::Node) -> Self {
Self {
node_list: self.node_list.clone(real_parent),
}
}
pub(super) fn start_clone(&self) -> Self {
Self {
node_list: self.node_list.start_clone(),
}
}
}