mirror of
https://github.com/servo/servo.git
synced 2025-09-06 13:08:21 +01:00
Fix positioning of RTL blocks with margins.
`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.
This commit is contained in:
parent
8979d77e77
commit
dc19806b15
4 changed files with 73 additions and 11 deletions
35
tests/ref/rtl_margin_a.html
Normal file
35
tests/ref/rtl_margin_a.html
Normal 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>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue