mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
auto merge of #4425 : SimonSapin/servo/mixed-writing-modes, r=mbrubeck
The rendering is still wrong beause of #2795, but at least we get a rendering. (This test change is just for readability, it should be equivalent to before.) r? @mbrubeck
This commit is contained in:
commit
3cc87165a1
3 changed files with 21 additions and 11 deletions
|
@ -1783,9 +1783,9 @@ impl Flow for BlockFlow {
|
||||||
if !flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED) {
|
if !flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED) {
|
||||||
let kid_base = flow::mut_base(kid);
|
let kid_base = flow::mut_base(kid);
|
||||||
kid_base.stacking_relative_position =
|
kid_base.stacking_relative_position =
|
||||||
origin_for_children +
|
origin_for_children
|
||||||
(kid_base.position.start + relative_offset).to_physical(writing_mode,
|
+ kid_base.position.start.to_physical(kid_base.writing_mode, container_size)
|
||||||
container_size);
|
+ relative_offset.to_physical(writing_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
flow::mut_base(kid).absolute_position_info = absolute_position_info_for_children;
|
flow::mut_base(kid).absolute_position_info = absolute_position_info_for_children;
|
||||||
|
|
|
@ -1191,20 +1191,27 @@ impl<'a> MutableFlowUtils for &'a mut Flow + 'a {
|
||||||
let mut overflow = my_position;
|
let mut overflow = my_position;
|
||||||
|
|
||||||
if self.is_block_container() {
|
if self.is_block_container() {
|
||||||
|
let writing_mode = base(self).writing_mode;
|
||||||
|
// FIXME(#2795): Get the real container size
|
||||||
|
let container_size = Size2D::zero();
|
||||||
for kid in child_iter(self) {
|
for kid in child_iter(self) {
|
||||||
if kid.is_store_overflow_delayed() {
|
if kid.is_store_overflow_delayed() {
|
||||||
// Absolute flows will be handled by their CB. If we are
|
// Absolute flows will be handled by their CB. If we are
|
||||||
// their CB, they will show up in `abs_descendants`.
|
// their CB, they will show up in `abs_descendants`.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let mut kid_overflow = base(kid).overflow;
|
let kid_base = base(kid);
|
||||||
|
let mut kid_overflow = kid_base.overflow.convert(
|
||||||
|
kid_base.writing_mode, writing_mode, container_size);
|
||||||
kid_overflow = kid_overflow.translate(&my_position.start);
|
kid_overflow = kid_overflow.translate(&my_position.start);
|
||||||
overflow = overflow.union(&kid_overflow)
|
overflow = overflow.union(&kid_overflow)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME(#2004, pcwalton): This is wrong for `position: fixed`.
|
// FIXME(#2004, pcwalton): This is wrong for `position: fixed`.
|
||||||
for descendant_link in mut_base(self).abs_descendants.iter() {
|
for descendant_link in mut_base(self).abs_descendants.iter() {
|
||||||
let mut kid_overflow = base(descendant_link).overflow;
|
let kid_base = base(descendant_link);
|
||||||
|
let mut kid_overflow = kid_base.overflow.convert(
|
||||||
|
kid_base.writing_mode, writing_mode, container_size);
|
||||||
kid_overflow = kid_overflow.translate(&my_position.start);
|
kid_overflow = kid_overflow.translate(&my_position.start);
|
||||||
overflow = overflow.union(&kid_overflow)
|
overflow = overflow.union(&kid_overflow)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,17 @@
|
||||||
<head>
|
<head>
|
||||||
<title>Block with over-contrained margins+borders+padding+width = containing block width</title>
|
<title>Block with over-contrained margins+borders+padding+width = containing block width</title>
|
||||||
<style>
|
<style>
|
||||||
body { width: 300px; margin: 0 }
|
body { width: 300px; margin: 0 0 0 400px }
|
||||||
p { background: green; width: 200px; height: 100px; margin: 20px 70px }
|
div:nth-child(even) { direction: rtl }
|
||||||
|
div:nth-child(1) p, div:nth-child(2) p { margin: 20px 70px }
|
||||||
|
div:nth-child(3) p, div:nth-child(4) p { margin: 20px 120px }
|
||||||
|
p { background: green; width: 200px; height: 100px }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p style="margin: 20px 70px"></p>
|
<div><p></p></div>
|
||||||
<p style="margin: 20px 70px; direction: rtl"></p>
|
<div><p></p></div>
|
||||||
<p style="margin: 20px 120px"></p>
|
<div><p></p></div>
|
||||||
<p style="margin: 20px 120px; direction: rtl"></p>
|
<div><p></p></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue