diff options
Diffstat (limited to 'src/components/main/layout/layout_task.rs')
-rw-r--r-- | src/components/main/layout/layout_task.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/components/main/layout/layout_task.rs b/src/components/main/layout/layout_task.rs index 8a52d93b284..0fdacec78ad 100644 --- a/src/components/main/layout/layout_task.rs +++ b/src/components/main/layout/layout_task.rs @@ -212,7 +212,11 @@ impl<'a> PostorderFlowTraversal for AssignHeightsAndStoreOverflowTraversal<'a> { #[inline] fn process(&mut self, flow: &mut Flow) -> bool { flow.assign_height(self.layout_context); - flow.store_overflow(self.layout_context); + // Skip store-overflow for absolutely positioned flows. That will be + // done in a separate traversal. + if !flow.is_store_overflow_delayed() { + flow.store_overflow(self.layout_context); + } true } @@ -427,7 +431,17 @@ impl LayoutTask { None => fail!("no layout data for root node"), }; let mut flow = match result { - FlowConstructionResult(flow) => flow, + FlowConstructionResult(mut flow, abs_descendants, fixed_descendants) => { + // Note: Assuming that the root has display 'static' (as per + // CSS Section 9.3.1). Otherwise, if it were absolutely + // positioned, it would return a reference to itself in + // `abs_descendants` and would lead to a circular reference. + // Set Root as CB for any remaining absolute descendants. + flow.set_abs_descendants(abs_descendants); + // Set Root as CB for all fixed descendants. + flow.set_fixed_descendants(fixed_descendants); + flow + } _ => fail!("Flow construction didn't result in a flow at the root of the tree!"), }; flow.mark_as_root(); |