From 17e378b099eda21f2fa66119c8f801234b83bf7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Tue, 25 Apr 2017 21:05:26 +0300 Subject: [PATCH] Fix variable serialization bug on alias properties --- components/style/properties/properties.mako.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 9f486772f4c..f4744c5135e 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -1223,8 +1223,11 @@ impl ToCss for PropertyDeclaration { PropertyDeclaration::CSSWideKeyword(_, keyword) => keyword.to_css(dest), PropertyDeclaration::WithVariables(_, ref with_variables) => { // https://drafts.csswg.org/css-variables/#variables-in-shorthands - if with_variables.from_shorthand.is_none() { - dest.write_str(&*with_variables.css)? + match with_variables.from_shorthand { + Some(shorthand) if shorthand.flags().contains(ALIAS_PROPERTY) => + dest.write_str(&*with_variables.css)?, + None => dest.write_str(&*with_variables.css)?, + _ => {}, } Ok(()) }, @@ -1302,7 +1305,12 @@ impl PropertyDeclaration { if s == shorthand { Some(&*with_variables.css) } else { None } - } else { None } + } else { + if shorthand.flags().contains(ALIAS_PROPERTY) { + return Some(&*with_variables.css); + } + None + } }, _ => None, }