mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Serialize 'initial' as "initial", not as the inital value.
This commit is contained in:
parent
149053c2a7
commit
00e7b56244
1 changed files with 5 additions and 6 deletions
|
@ -2449,11 +2449,11 @@ pub enum DeclaredValue<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Show> DeclaredValue<T> {
|
impl<T: Show> DeclaredValue<T> {
|
||||||
pub fn specified_value(&self) -> Option<String> {
|
pub fn specified_value(&self) -> String {
|
||||||
match self {
|
match self {
|
||||||
&DeclaredValue::SpecifiedValue(ref inner) => Some(format!("{:?}", inner)),
|
&DeclaredValue::SpecifiedValue(ref inner) => format!("{:?}", inner),
|
||||||
&DeclaredValue::Initial => None,
|
&DeclaredValue::Initial => "initial".to_owned(),
|
||||||
&DeclaredValue::Inherit => Some("inherit".to_owned()),
|
&DeclaredValue::Inherit => "inherit".to_owned(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2491,8 +2491,7 @@ impl PropertyDeclaration {
|
||||||
% for property in LONGHANDS:
|
% for property in LONGHANDS:
|
||||||
% if property.derived_from is None:
|
% if property.derived_from is None:
|
||||||
&PropertyDeclaration::${property.camel_case}(ref value) =>
|
&PropertyDeclaration::${property.camel_case}(ref value) =>
|
||||||
value.specified_value()
|
value.specified_value(),
|
||||||
.unwrap_or_else(|| format!("{:?}", longhands::${property.ident}::get_initial_value())),
|
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
decl => panic!("unsupported property declaration: {:?}", decl.name()),
|
decl => panic!("unsupported property declaration: {:?}", decl.name()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue