Fix variable serialization bug on alias properties

This commit is contained in:
Nazım Can Altınova 2017-04-25 21:05:26 +03:00
parent 3c7c960e11
commit 17e378b099
No known key found for this signature in database
GPG key ID: AF9BCD7CE6449954

View file

@ -1223,8 +1223,11 @@ impl ToCss for PropertyDeclaration {
PropertyDeclaration::CSSWideKeyword(_, keyword) => keyword.to_css(dest), PropertyDeclaration::CSSWideKeyword(_, keyword) => keyword.to_css(dest),
PropertyDeclaration::WithVariables(_, ref with_variables) => { PropertyDeclaration::WithVariables(_, ref with_variables) => {
// https://drafts.csswg.org/css-variables/#variables-in-shorthands // https://drafts.csswg.org/css-variables/#variables-in-shorthands
if with_variables.from_shorthand.is_none() { match with_variables.from_shorthand {
dest.write_str(&*with_variables.css)? Some(shorthand) if shorthand.flags().contains(ALIAS_PROPERTY) =>
dest.write_str(&*with_variables.css)?,
None => dest.write_str(&*with_variables.css)?,
_ => {},
} }
Ok(()) Ok(())
}, },
@ -1302,7 +1305,12 @@ impl PropertyDeclaration {
if s == shorthand { if s == shorthand {
Some(&*with_variables.css) Some(&*with_variables.css)
} else { None } } else { None }
} else { None } } else {
if shorthand.flags().contains(ALIAS_PROPERTY) {
return Some(&*with_variables.css);
}
None
}
}, },
_ => None, _ => None,
} }