Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some writing mode mismatch assertions errors. #4425

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix some writing mode mismatch assertions errors.

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.)
  • Loading branch information
SimonSapin committed Dec 18, 2014
commit 7be30dee8e480dc1e965fe693061a795749d7786
@@ -1783,9 +1783,9 @@ impl Flow for BlockFlow {
if !flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED) {
let kid_base = flow::mut_base(kid);
kid_base.stacking_relative_position =
origin_for_children +
(kid_base.position.start + relative_offset).to_physical(writing_mode,
container_size);
origin_for_children
+ kid_base.position.start.to_physical(kid_base.writing_mode, container_size)
+ relative_offset.to_physical(writing_mode);
}

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;

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) {
if kid.is_store_overflow_delayed() {
// Absolute flows will be handled by their CB. If we are
// their CB, they will show up in `abs_descendants`.
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);
overflow = overflow.union(&kid_overflow)
}

// FIXME(#2004, pcwalton): This is wrong for `position: fixed`.
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);
overflow = overflow.union(&kid_overflow)
}
@@ -2,14 +2,17 @@
<head>
<title>Block with over-contrained margins+borders+padding+width = containing block width</title>
<style>
body { width: 300px; margin: 0 }
p { background: green; width: 200px; height: 100px; margin: 20px 70px }
body { width: 300px; margin: 0 0 0 400px }
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>
</head>
<body>
<p style="margin: 20px 70px"></p>
<p style="margin: 20px 70px; direction: rtl"></p>
<p style="margin: 20px 120px"></p>
<p style="margin: 20px 120px; direction: rtl"></p>
<div><p></p></div>
<div><p></p></div>
<div><p></p></div>
<div><p></p></div>
</body>
</html>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.