Implement concept of dirty root

This commit is contained in:
Anthony Ramine 2020-04-27 17:54:06 +02:00
parent 518c0660c6
commit 036f123c4e
11 changed files with 251 additions and 64 deletions

View file

@ -30,6 +30,10 @@ impl<'a> RecalcStyleAndConstructFlows<'a> {
RecalcStyleAndConstructFlows { context: context }
}
pub fn context(&self) -> &LayoutContext<'a> {
&self.context
}
/// Consumes this traversal context, returning ownership of the shared layout
/// context to the caller.
pub fn destroy(self) -> LayoutContext<'a> {
@ -183,6 +187,19 @@ where
fn process(&mut self, node: &ConcreteThreadSafeLayoutNode);
}
#[allow(unsafe_code)]
#[inline]
pub unsafe fn construct_flows_at_ancestors<'dom>(
context: &LayoutContext,
mut node: impl LayoutNode<'dom>,
) {
while let Some(element) = node.traversal_parent() {
element.set_dirty_descendants();
node = element.as_node();
construct_flows_at(context, node);
}
}
/// The flow construction traversal, which builds flows for styled nodes.
#[inline]
#[allow(unsafe_code)]