diff options
author | Anthony Ramine <nox@nox.paris> | 2019-11-29 10:07:48 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2019-12-01 10:52:34 +0100 |
commit | f24e8d0557c6cb51fac0a5e8ff4046ec6a1717d3 (patch) | |
tree | e4a23058462a18abd1e1b434a03f001c9d79cab9 /components/layout_2020 | |
parent | 48a4a82a496fd0cc76ab21606618de5e408900b6 (diff) | |
download | servo-f24e8d0557c6cb51fac0a5e8ff4046ec6a1717d3.tar.gz servo-f24e8d0557c6cb51fac0a5e8ff4046ec6a1717d3.zip |
Fix inline margins of in flow blocks in 2020
Diffstat (limited to 'components/layout_2020')
-rw-r--r-- | components/layout_2020/flow/mod.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index 9281c135760..5c2e3d8e988 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -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); }, } } |