diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/main/layout/construct.rs | 8 | ||||
-rw-r--r-- | src/test/ref/basic.list | 1 | ||||
-rw-r--r-- | src/test/ref/position_abs_pseudo_a.html | 21 | ||||
-rw-r--r-- | src/test/ref/position_abs_pseudo_b.html | 19 |
4 files changed, 46 insertions, 3 deletions
diff --git a/src/components/main/layout/construct.rs b/src/components/main/layout/construct.rs index 78a2fde4e84..ef6d737f2d9 100644 --- a/src/components/main/layout/construct.rs +++ b/src/components/main/layout/construct.rs @@ -879,9 +879,11 @@ 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) => { + // Only match here for block items. If an item is absolutely + // positioned, but inline we shouldn't try to construct a block + // flow here - instead, let it match the inline case + // below. + (display::block, _, position::absolute) | (_, _, position::fixed) => { node.set_flow_construction_result(self.build_flow_for_block(node)) } diff --git a/src/test/ref/basic.list b/src/test/ref/basic.list index 43def47ea67..ac56fbfabe6 100644 --- a/src/test/ref/basic.list +++ b/src/test/ref/basic.list @@ -51,6 +51,7 @@ == position_abs_replaced_simple_a.html position_abs_replaced_simple_b.html == position_abs_static_y_a.html position_abs_static_y_b.html == position_abs_width_percentage_a.html position_abs_width_percentage_b.html +== position_abs_pseudo_a.html position_abs_pseudo_b.html # commented out because multiple layers don't work with reftests --pcwalton # == position_fixed_a.html position_fixed_b.html # == position_fixed_simple_a.html position_fixed_simple_b.html diff --git a/src/test/ref/position_abs_pseudo_a.html b/src/test/ref/position_abs_pseudo_a.html new file mode 100644 index 00000000000..938864456c7 --- /dev/null +++ b/src/test/ref/position_abs_pseudo_a.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html> + <head> + <style> + body { + margin: 0; + } + div:before { + position: absolute; + width: 100px; + height: 100px; + background-color: red; + content: ""; + } + </style> + </head> + <body> + <div> + </div> + </body> +</html> diff --git a/src/test/ref/position_abs_pseudo_b.html b/src/test/ref/position_abs_pseudo_b.html new file mode 100644 index 00000000000..19f3ed47cfa --- /dev/null +++ b/src/test/ref/position_abs_pseudo_b.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> + <head> + <style> + body { + margin: 0; + } + .before { + width: 100px; + height: 100px; + background-color: red; + } + </style> + </head> + <body> + <div class="before"> + </div> + </body> +</html> |