diff options
author | S Pradeep Kumar <gohanpra@gmail.com> | 2014-02-20 16:23:20 +0900 |
---|---|---|
committer | S Pradeep Kumar <gohanpra@gmail.com> | 2014-03-03 16:12:45 +0900 |
commit | 75f1142107af9a96ea3a997048e03c0e37b51b1c (patch) | |
tree | bfd01bc469ed6fea932dc96cc8bb05f652351e8f /src/components/main/layout/layout_task.rs | |
parent | c4d177a3541b55c4b979afc8e7171fe0cfb4817e (diff) | |
download | servo-75f1142107af9a96ea3a997048e03c0e37b51b1c.tar.gz servo-75f1142107af9a96ea3a997048e03c0e37b51b1c.zip |
Implement mini-traversal for absolute flow assign-height.
This only traverses absolute flows, nothing else.
+ Also, a separate mini-traversal for store overflow.
+ Store descendants with position 'absolute' and 'fixed' in BaseFlow.
+ Bubble up links to absolute and fixed descendants during Flow Construction.
+ Set Rawlink to the CB in absolute descendants.
+ store_overflow() now uses absolute descendants' overflows too.
+ Add reftests for 'absolute' and 'fixed' static y position.
+ Add reftests for overflow (they all fail now).
+ Put absolute flow display items under their CB's ClipDisplayItem.
+ Paint borders in Box_ before the actual box stuff (minor fix in lieu of paint-order).
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(); |