Implement position: absolute for replaced elements.

Add reftests for replaced and nested absolute flows.
This commit is contained in:
S Pradeep Kumar 2014-02-18 15:33:25 +09:00
parent 4a6077ca4c
commit 070be51910
9 changed files with 402 additions and 43 deletions

View file

@ -687,6 +687,13 @@ impl<'a> FlowConstructor<'a> {
}
impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
// Construct Flow based on 'display', 'position', and 'float' values.
//
// CSS 2.1 Section 9.7
//
// TODO: This should actually consult the table in that section to get the
// final computed value for 'display'.
//
// `#[inline(always)]` because this is always called from the traversal function and for some
// reason LLVM's inlining heuristics go awry here.
#[inline(always)]
@ -718,6 +725,10 @@ impl<'a> PostorderNodeMutTraversal for FlowConstructor<'a> {
}
}
// Absolutely positioned elements will have computed value of
// `float` as 'none' and `display` as per the table.
// Currently, for original `display` value of 'inline', the new
// `display` value is 'block'.
(_, _, position::absolute) | (_, _, position::fixed) => {
node.set_flow_construction_result(self.build_flow_for_block(node))
}