mirror of
https://github.com/servo/servo.git
synced 2025-07-03 05:23:38 +01:00
Fix variable serialization bug on alias properties
This commit is contained in:
parent
3c7c960e11
commit
17e378b099
1 changed files with 11 additions and 3 deletions
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue