diff options
author | S Pradeep Kumar <gohanpra@gmail.com> | 2014-02-18 15:33:25 +0900 |
---|---|---|
committer | S Pradeep Kumar <gohanpra@gmail.com> | 2014-03-04 11:08:46 +0900 |
commit | 070be519107b180af7db77ebffb074fe7504c1e3 (patch) | |
tree | 33df290fd485880858e4018a98c2ace15c328d80 /src/components/main/layout/construct.rs | |
parent | 4a6077ca4cb6e2d54e2f558c18f45849c9d3c47d (diff) | |
download | servo-070be519107b180af7db77ebffb074fe7504c1e3.tar.gz servo-070be519107b180af7db77ebffb074fe7504c1e3.zip |
Implement `position: absolute` for replaced elements.
Add reftests for replaced and nested absolute flows.
Diffstat (limited to 'src/components/main/layout/construct.rs')
-rw-r--r-- | src/components/main/layout/construct.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/components/main/layout/construct.rs b/src/components/main/layout/construct.rs index 745ee21c173..ffccaa02f69 100644 --- a/src/components/main/layout/construct.rs +++ b/src/components/main/layout/construct.rs @@ -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)) } |