Auto merge of #6049 - mbrubeck:position-rtl, r=pcwalton

`BaseFlow::position` is relative to the parent flow's margin box in the inline direction.  We need to use the parent's `position` as the container size when translating it to physical coordinates, or we get incorrect results for non-LTR content.

r? @pcwalton

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6049)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-05-14 12:52:27 -05:00
commit 5a737bae1a
4 changed files with 73 additions and 11 deletions

View file

@ -264,6 +264,7 @@ experimental != overconstrained_block.html overconstrained_block_ref.html
== root_margin_collapse_a.html root_margin_collapse_b.html
== root_pseudo_a.html root_pseudo_b.html
experimental == rtl_body.html rtl_body_ref.html
experimental == rtl_margin_a.html rtl_margin_ref.html
experimental == rtl_simple.html rtl_simple_ref.html
== servo_center_a.html servo_center_ref.html
== setattribute_id_restyle_a.html setattribute_id_restyle_b.html

View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>RTL margin test</title>
<style>
body {
margin: 8px;
}
#a {
direction: rtl;
}
#b {
border: 1px solid red;
width: 100px;
height: 100px;
}
#c {
border: 1px solid blue;
margin: 10px;
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<div id="a">
<div id="b">
<div id="c">
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>RTL margin test</title>
<style>
#b {
border: 1px solid red;
width: 100px;
height: 100px;
position: absolute;
top: 8px;
right: 8px;
}
#c {
border: 1px solid blue;
position: absolute;
top: 10px;
right: 10px;
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<div id="a">
<div id="b">
<div id="c">
</div>
</div>
</div>
</body>
</html>