Skip to content

Commit

Permalink
Fix inline margins of in flow blocks in 2020
Browse files Browse the repository at this point in the history
  • Loading branch information
nox authored and SimonSapin committed Dec 1, 2019
1 parent 48a4a82 commit f24e8d0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions components/layout_2020/flow/mod.rs
Expand Up @@ -369,16 +369,13 @@ fn layout_in_flow_non_replaced_block_level<'a>(
*s = LengthOrAuto::LengthPercentage(inline_margins / 2.);
*e = LengthOrAuto::LengthPercentage(inline_margins / 2.);
},
(s @ &mut LengthOrAuto::Auto, _) => {
*s = LengthOrAuto::LengthPercentage(inline_margins);
(s @ &mut LengthOrAuto::Auto, &mut LengthOrAuto::LengthPercentage(e)) => {
*s = LengthOrAuto::LengthPercentage(inline_margins - e);
},
(_, e @ &mut LengthOrAuto::Auto) => {
*e = LengthOrAuto::LengthPercentage(inline_margins);
},
(_, e @ _) => {
(&mut LengthOrAuto::LengthPercentage(s), e) => {
// Either the inline-end margin is auto,
// or we’re over-constrained and we do as if it were.
*e = LengthOrAuto::LengthPercentage(inline_margins);
*e = LengthOrAuto::LengthPercentage(inline_margins - s);
},
}
}
Expand Down

0 comments on commit f24e8d0

Please sign in to comment.