From 00e7b562444b3d86ac44e8baafd3a5fbf0f23681 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Fri, 6 Feb 2015 08:52:59 +1100 Subject: [PATCH] Serialize 'initial' as "initial", not as the inital value. --- components/style/properties.mako.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/style/properties.mako.rs b/components/style/properties.mako.rs index 8b2bdb6398c..4ac7f6902de 100644 --- a/components/style/properties.mako.rs +++ b/components/style/properties.mako.rs @@ -2449,11 +2449,11 @@ pub enum DeclaredValue { } impl DeclaredValue { - pub fn specified_value(&self) -> Option { + pub fn specified_value(&self) -> String { match self { - &DeclaredValue::SpecifiedValue(ref inner) => Some(format!("{:?}", inner)), - &DeclaredValue::Initial => None, - &DeclaredValue::Inherit => Some("inherit".to_owned()), + &DeclaredValue::SpecifiedValue(ref inner) => format!("{:?}", inner), + &DeclaredValue::Initial => "initial".to_owned(), + &DeclaredValue::Inherit => "inherit".to_owned(), } } } @@ -2491,8 +2491,7 @@ impl PropertyDeclaration { % for property in LONGHANDS: % if property.derived_from is None: &PropertyDeclaration::${property.camel_case}(ref value) => - value.specified_value() - .unwrap_or_else(|| format!("{:?}", longhands::${property.ident}::get_initial_value())), + value.specified_value(), % endif % endfor decl => panic!("unsupported property declaration: {:?}", decl.name()),