From f24e8d0557c6cb51fac0a5e8ff4046ec6a1717d3 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 29 Nov 2019 10:07:48 +0100 Subject: [PATCH] Fix inline margins of in flow blocks in 2020 --- components/layout_2020/flow/mod.rs | 11 ++++------- 1 file 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); }, } }