Remove postorder traversal from layout 2020 during styling

This commit is contained in:
Anthony Ramine 2020-04-06 12:40:05 +02:00
parent e3be136c9b
commit 88d79fe46d

View file

@ -45,23 +45,26 @@ where
) where
F: FnMut(E::ConcreteNode),
{
unsafe { node.initialize_data() };
unsafe {
node.initialize_data();
if !node.is_text_node() {
let el = node.as_element().unwrap();
let mut data = el.mutate_data().unwrap();
recalc_style_at(self, traversal_data, context, el, &mut data, note_child);
}
}
fn process_postorder(&self, _style_context: &mut StyleContext<E>, node: E::ConcreteNode) {
if let Some(el) = node.as_element() {
unsafe {
el.unset_dirty_descendants();
}
}
}
#[inline]
fn needs_postorder_traversal() -> bool {
false
}
fn process_postorder(&self, _style_context: &mut StyleContext<E>, _node: E::ConcreteNode) {
panic!("this should never be called")
}
fn text_node_needs_traversal(node: E::ConcreteNode, parent_data: &ElementData) -> bool {
node.get_style_and_layout_data().is_none() || !parent_data.damage.is_empty()
}