From 29fd30601e09479ba329ad294b1ea7147a80f4bd Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Tue, 28 Feb 2017 18:17:59 +1100 Subject: [PATCH] Simplify values of CSSWideKeyword --- components/style/properties/helpers.mako.rs | 6 ++--- .../style/properties/properties.mako.rs | 24 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 8b674a6c96e..28c5fdb4f35 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -324,9 +324,9 @@ -> Result, ()> { % endif match input.try(|i| CSSWideKeyword::parse(context, i)) { - Ok(CSSWideKeyword::InheritKeyword) => Ok(DeclaredValue::Inherit), - Ok(CSSWideKeyword::InitialKeyword) => Ok(DeclaredValue::Initial), - Ok(CSSWideKeyword::UnsetKeyword) => Ok(DeclaredValue::Unset), + Ok(CSSWideKeyword::Inherit) => Ok(DeclaredValue::Inherit), + Ok(CSSWideKeyword::Initial) => Ok(DeclaredValue::Initial), + Ok(CSSWideKeyword::Unset) => Ok(DeclaredValue::Unset), Err(()) => { input.look_for_var_functions(); let start = input.position(); diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index d582debeba2..c0f887a9a3c 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -376,11 +376,11 @@ impl PropertyDeclarationIdSet { #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub enum CSSWideKeyword { /// The `initial` keyword. - InitialKeyword, + Initial, /// The `inherit` keyword. - InheritKeyword, + Inherit, /// The `unset` keyword. - UnsetKeyword, + Unset, } impl Parse for CSSWideKeyword { @@ -388,9 +388,9 @@ impl Parse for CSSWideKeyword { let ident = input.expect_ident()?; input.expect_exhausted()?; match_ignore_ascii_case! { &ident, - "initial" => Ok(CSSWideKeyword::InitialKeyword), - "inherit" => Ok(CSSWideKeyword::InheritKeyword), - "unset" => Ok(CSSWideKeyword::UnsetKeyword), + "initial" => Ok(CSSWideKeyword::Initial), + "inherit" => Ok(CSSWideKeyword::Inherit), + "unset" => Ok(CSSWideKeyword::Unset), _ => Err(()) } } @@ -969,9 +969,9 @@ impl PropertyDeclaration { match id { PropertyId::Custom(name) => { let value = match input.try(|i| CSSWideKeyword::parse(context, i)) { - Ok(CSSWideKeyword::UnsetKeyword) => DeclaredValue::Unset, - Ok(CSSWideKeyword::InheritKeyword) => DeclaredValue::Inherit, - Ok(CSSWideKeyword::InitialKeyword) => DeclaredValue::Initial, + Ok(CSSWideKeyword::Unset) => DeclaredValue::Unset, + Ok(CSSWideKeyword::Inherit) => DeclaredValue::Inherit, + Ok(CSSWideKeyword::Initial) => DeclaredValue::Initial, Err(()) => match ::custom_properties::SpecifiedValue::parse(context, input) { Ok(value) => DeclaredValue::Value(value), Err(()) => return PropertyDeclarationParseResult::InvalidValue, @@ -1029,7 +1029,7 @@ impl PropertyDeclaration { ${property_pref_check(shorthand)} match input.try(|i| CSSWideKeyword::parse(context, i)) { - Ok(CSSWideKeyword::InheritKeyword) => { + Ok(CSSWideKeyword::Inherit) => { % for sub_property in shorthand.sub_properties: result_list.push(( PropertyDeclaration::${sub_property.camel_case}( @@ -1037,7 +1037,7 @@ impl PropertyDeclaration { % endfor PropertyDeclarationParseResult::ValidOrIgnoredDeclaration }, - Ok(CSSWideKeyword::InitialKeyword) => { + Ok(CSSWideKeyword::Initial) => { % for sub_property in shorthand.sub_properties: result_list.push(( PropertyDeclaration::${sub_property.camel_case}( @@ -1045,7 +1045,7 @@ impl PropertyDeclaration { % endfor PropertyDeclarationParseResult::ValidOrIgnoredDeclaration }, - Ok(CSSWideKeyword::UnsetKeyword) => { + Ok(CSSWideKeyword::Unset) => { % for sub_property in shorthand.sub_properties: result_list.push((PropertyDeclaration::${sub_property.camel_case}( DeclaredValue::Unset), Importance::Normal));