auto merge of #2411 : glennw/servo/issue-2335, r=pcwalton

This commit is contained in:
bors-servo 2014-05-22 09:17:13 -04:00
commit 891ca73785
4 changed files with 46 additions and 3 deletions

View file

@ -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))
}

View file

@ -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

View file

@ -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>

View file

@ -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>