Add a 'dom lifetime to GetLayoutData

This commit is contained in:
Anthony Ramine 2020-03-26 13:17:46 +01:00
parent 2d055cbf6b
commit 04af32128c
15 changed files with 130 additions and 125 deletions

View file

@ -38,10 +38,10 @@ impl<'a> RecalcStyleAndConstructFlows<'a> {
}
#[allow(unsafe_code)]
impl<'a, E> DomTraversal<E> for RecalcStyleAndConstructFlows<'a>
impl<'a, 'dom, E> DomTraversal<E> for RecalcStyleAndConstructFlows<'a>
where
E: TElement,
E::ConcreteNode: LayoutNode,
E::ConcreteNode: LayoutNode<'dom>,
E::FontMetricsProvider: Send,
{
fn process_preorder<F>(
@ -175,7 +175,10 @@ pub trait InorderFlowTraversal {
}
/// A bottom-up, parallelizable traversal.
pub trait PostorderNodeMutTraversal<ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> {
pub trait PostorderNodeMutTraversal<'dom, ConcreteThreadSafeLayoutNode>
where
ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode<'dom>,
{
/// The operation to perform. Return true to continue or false to stop.
fn process(&mut self, node: &ConcreteThreadSafeLayoutNode);
}
@ -183,10 +186,7 @@ pub trait PostorderNodeMutTraversal<ConcreteThreadSafeLayoutNode: ThreadSafeLayo
/// The flow construction traversal, which builds flows for styled nodes.
#[inline]
#[allow(unsafe_code)]
fn construct_flows_at<N>(context: &LayoutContext, node: N)
where
N: LayoutNode,
{
fn construct_flows_at<'dom>(context: &LayoutContext, node: impl LayoutNode<'dom>) {
debug!("construct_flows_at: {:?}", node);
// Construct flows for this node.