Bug 1371115 - Part 9: rename macro from impl_gecko_keyword_from_trait to impl_gecko_keyword_conversions. r?hiro
Name of other macros that implement From trait is XX_conversions.
However, impl_gecko_keyword_from_trait macro name is not consistency.
MozReview-Commit-ID: K719RyEMP8K
--- a/servo/components/style/properties/longhand/font.mako.rs
+++ b/servo/components/style/properties/longhand/font.mako.rs
@@ -11,17 +11,17 @@
%if product == "gecko":
${caller.body()}
%else:
unreachable!()
%endif
</%def>
#[cfg(feature = "gecko")]
-macro_rules! impl_gecko_keyword_from_trait {
+macro_rules! impl_gecko_keyword_conversions {
($name: ident, $utype: ty) => {
impl From<$utype> for $name {
fn from(bits: $utype) -> $name {
$name::from_gecko_keyword(bits)
}
}
impl From<$name> for $utype {
@@ -1618,17 +1618,17 @@ macro_rules! exclusive_value {
if !result.is_empty() {
Ok(SpecifiedValue::Value(result))
} else {
Err(StyleParseError::UnspecifiedError.into())
}
}
#[cfg(feature = "gecko")]
- impl_gecko_keyword_from_trait!(VariantEastAsian, u16);
+ impl_gecko_keyword_conversions!(VariantEastAsian, u16);
</%helpers:longhand>
<%helpers:longhand name="font-variant-ligatures" products="gecko" animation_value_type="discrete"
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-ligatures">
use properties::longhands::system_font::SystemFont;
use std::fmt;
use style_traits::ToCss;
@@ -1777,17 +1777,17 @@ macro_rules! exclusive_value {
if !result.is_empty() {
Ok(SpecifiedValue::Value(result))
} else {
Err(StyleParseError::UnspecifiedError.into())
}
}
#[cfg(feature = "gecko")]
- impl_gecko_keyword_from_trait!(VariantLigatures, u16);
+ impl_gecko_keyword_conversions!(VariantLigatures, u16);
</%helpers:longhand>
<%helpers:longhand name="font-variant-numeric" products="gecko" animation_value_type="discrete"
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-numeric">
use properties::longhands::system_font::SystemFont;
use std::fmt;
use style_traits::ToCss;
@@ -1925,17 +1925,17 @@ macro_rules! exclusive_value {
if !result.is_empty() {
Ok(SpecifiedValue::Value(result))
} else {
Err(StyleParseError::UnspecifiedError.into())
}
}
#[cfg(feature = "gecko")]
- impl_gecko_keyword_from_trait!(VariantNumeric, u8);
+ impl_gecko_keyword_conversions!(VariantNumeric, u8);
</%helpers:longhand>
${helpers.single_keyword_system("font-variant-position",
"normal sub super",
products="gecko",
gecko_ffi_name="mFont.variantPosition",
gecko_constant_prefix="NS_FONT_VARIANT_POSITION",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-position",