aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2014-05-22 09:17:13 -0400
committerbors-servo <release+servo@mozilla.com>2014-05-22 09:17:13 -0400
commit891ca7378583418c8739d833b21173f012258cbf (patch)
tree93605d46da5c35295257241956836d49269627cb /src
parent28e3c1734048217cd2194ea37c887911ad03e894 (diff)
parent0bb518561ee323d49efa598a29b7b71316c0e588 (diff)
downloadservo-891ca7378583418c8739d833b21173f012258cbf.tar.gz
servo-891ca7378583418c8739d833b21173f012258cbf.zip
auto merge of #2411 : glennw/servo/issue-2335, r=pcwalton
Diffstat (limited to 'src')
-rw-r--r--src/components/main/layout/construct.rs8
-rw-r--r--src/test/ref/basic.list1
-rw-r--r--src/test/ref/position_abs_pseudo_a.html21
-rw-r--r--src/test/ref/position_abs_pseudo_b.html19
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>