mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Implement concept of dirty root
This commit is contained in:
parent
518c0660c6
commit
036f123c4e
11 changed files with 251 additions and 64 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue