diff options
Diffstat (limited to 'components/layout/traversal.rs')
-rw-r--r-- | components/layout/traversal.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index 4fb3838d18e..88a6514433b 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -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)] |