style: Reformat font.mako.rs.

To be consistent, use the block indentation the rest of the Rust code uses.

Differential Revision: https://phabricator.services.mozilla.com/D1906
Bug: 1472552
Reviewed-by: xidorn
This commit is contained in:
Emilio Cobos Álvarez 2018-07-01 23:06:17 +00:00
parent 41e105733c
commit c23dca874f
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -7,13 +7,15 @@
<% data.new_style_struct("Font", inherited=True) %> <% data.new_style_struct("Font", inherited=True) %>
${helpers.predefined_type("font-family", ${helpers.predefined_type(
"FontFamily", "font-family",
initial_value="computed::FontFamily::serif()", "FontFamily",
animation_value_type="discrete", initial_value="computed::FontFamily::serif()",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-family", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
servo_restyle_damage="rebuild_and_reflow")} spec="https://drafts.csswg.org/css-fonts/#propdef-font-family",
servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"font-style", "font-style",
@ -32,16 +34,18 @@ ${helpers.predefined_type(
"all-petite-caps": "ALLPETITE", "all-petite-caps": "ALLPETITE",
"titling-caps": "TITLING" } %> "titling-caps": "TITLING" } %>
${helpers.single_keyword_system("font-variant-caps", ${helpers.single_keyword_system(
"normal small-caps", "font-variant-caps",
extra_gecko_values="all-small-caps petite-caps all-petite-caps unicase titling-caps", "normal small-caps",
gecko_constant_prefix="NS_FONT_VARIANT_CAPS", extra_gecko_values="all-small-caps petite-caps all-petite-caps unicase titling-caps",
gecko_ffi_name="mFont.variantCaps", gecko_constant_prefix="NS_FONT_VARIANT_CAPS",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-caps", gecko_ffi_name="mFont.variantCaps",
custom_consts=font_variant_caps_custom_consts, spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-caps",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", custom_consts=font_variant_caps_custom_consts,
animation_value_type="discrete", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
servo_restyle_damage="rebuild_and_reflow")} animation_value_type="discrete",
servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"font-weight", "font-weight",
@ -54,32 +58,38 @@ ${helpers.predefined_type(
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
)} )}
${helpers.predefined_type("font-size", ${helpers.predefined_type(
"FontSize", "font-size",
initial_value="computed::FontSize::medium()", "FontSize",
initial_specified_value="specified::FontSize::medium()", initial_value="computed::FontSize::medium()",
animation_value_type="NonNegativeLength", initial_specified_value="specified::FontSize::medium()",
allow_quirks=True, animation_value_type="NonNegativeLength",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", allow_quirks=True,
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
servo_restyle_damage="rebuild_and_reflow")} spec="https://drafts.csswg.org/css-fonts/#propdef-font-size",
servo_restyle_damage="rebuild_and_reflow",
)}
${helpers.predefined_type("font-size-adjust", ${helpers.predefined_type(
"FontSizeAdjust", "font-size-adjust",
products="gecko", "FontSizeAdjust",
initial_value="computed::FontSizeAdjust::none()", products="gecko",
initial_specified_value="specified::FontSizeAdjust::none()", initial_value="computed::FontSizeAdjust::none()",
animation_value_type="ComputedValue", initial_specified_value="specified::FontSizeAdjust::none()",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size-adjust")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size-adjust",
)}
${helpers.predefined_type("font-synthesis", ${helpers.predefined_type(
"FontSynthesis", "font-synthesis",
products="gecko", "FontSynthesis",
initial_value="specified::FontSynthesis::get_initial_value()", products="gecko",
animation_value_type="discrete", initial_value="specified::FontSynthesis::get_initial_value()",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-synthesis")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-synthesis",
)}
${helpers.predefined_type( ${helpers.predefined_type(
"font-stretch", "font-stretch",
@ -92,69 +102,83 @@ ${helpers.predefined_type(
servo_restyle_damage="rebuild_and_reflow", servo_restyle_damage="rebuild_and_reflow",
)} )}
${helpers.single_keyword_system("font-kerning", ${helpers.single_keyword_system(
"auto none normal", "font-kerning",
products="gecko", "auto none normal",
gecko_ffi_name="mFont.kerning", products="gecko",
gecko_constant_prefix="NS_FONT_KERNING", gecko_ffi_name="mFont.kerning",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-kerning", gecko_constant_prefix="NS_FONT_KERNING",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-kerning",
animation_value_type="discrete")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
animation_value_type="discrete",
)}
${helpers.predefined_type("font-variant-alternates", ${helpers.predefined_type(
"FontVariantAlternates", "font-variant-alternates",
products="gecko", "FontVariantAlternates",
initial_value="computed::FontVariantAlternates::get_initial_value()", products="gecko",
initial_specified_value="specified::FontVariantAlternates::get_initial_specified_value()", initial_value="computed::FontVariantAlternates::get_initial_value()",
animation_value_type="discrete", initial_specified_value="specified::FontVariantAlternates::get_initial_specified_value()",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-alternates")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-alternates",
)}
${helpers.predefined_type("font-variant-east-asian", ${helpers.predefined_type(
"FontVariantEastAsian", "font-variant-east-asian",
products="gecko", "FontVariantEastAsian",
initial_value="computed::FontVariantEastAsian::empty()", products="gecko",
initial_specified_value="specified::FontVariantEastAsian::empty()", initial_value="computed::FontVariantEastAsian::empty()",
animation_value_type="discrete", initial_specified_value="specified::FontVariantEastAsian::empty()",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-east-asian")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-east-asian",
)}
${helpers.predefined_type("font-variant-ligatures", ${helpers.predefined_type(
"FontVariantLigatures", "font-variant-ligatures",
products="gecko", "FontVariantLigatures",
initial_value="computed::FontVariantLigatures::empty()", products="gecko",
initial_specified_value="specified::FontVariantLigatures::empty()", initial_value="computed::FontVariantLigatures::empty()",
animation_value_type="discrete", initial_specified_value="specified::FontVariantLigatures::empty()",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-ligatures")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-ligatures",
)}
${helpers.predefined_type("font-variant-numeric", ${helpers.predefined_type(
"FontVariantNumeric", "font-variant-numeric",
products="gecko", "FontVariantNumeric",
initial_value="computed::FontVariantNumeric::empty()", products="gecko",
initial_specified_value="specified::FontVariantNumeric::empty()", initial_value="computed::FontVariantNumeric::empty()",
animation_value_type="discrete", initial_specified_value="specified::FontVariantNumeric::empty()",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-numeric")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-numeric",
)}
${helpers.single_keyword_system("font-variant-position", ${helpers.single_keyword_system(
"normal sub super", "font-variant-position",
products="gecko", "normal sub super",
gecko_ffi_name="mFont.variantPosition", products="gecko",
gecko_constant_prefix="NS_FONT_VARIANT_POSITION", gecko_ffi_name="mFont.variantPosition",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-position", gecko_constant_prefix="NS_FONT_VARIANT_POSITION",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-position",
animation_value_type="discrete")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
animation_value_type="discrete",
)}
${helpers.predefined_type("font-feature-settings", ${helpers.predefined_type(
"FontFeatureSettings", "font-feature-settings",
products="gecko", "FontFeatureSettings",
initial_value="computed::FontFeatureSettings::normal()", products="gecko",
initial_specified_value="specified::FontFeatureSettings::normal()", initial_value="computed::FontFeatureSettings::normal()",
extra_prefixes="moz:layout.css.prefixes.font-features", initial_specified_value="specified::FontFeatureSettings::normal()",
animation_value_type="discrete", extra_prefixes="moz:layout.css.prefixes.font-features",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-feature-settings")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-feature-settings",
)}
<% <%
# This spec link is too long to fit elsewhere # This spec link is too long to fit elsewhere
@ -163,100 +187,120 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control-
""" """
%> %>
${helpers.predefined_type("font-variation-settings", ${helpers.predefined_type(
"FontVariationSettings", "font-variation-settings",
products="gecko", "FontVariationSettings",
gecko_pref="layout.css.font-variations.enabled", products="gecko",
initial_value="computed::FontVariationSettings::normal()", gecko_pref="layout.css.font-variations.enabled",
initial_specified_value="specified::FontVariationSettings::normal()", initial_value="computed::FontVariationSettings::normal()",
animation_value_type="ComputedValue", initial_specified_value="specified::FontVariationSettings::normal()",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="ComputedValue",
spec="${variation_spec}")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="${variation_spec}",
)}
${helpers.predefined_type("font-language-override", ${helpers.predefined_type(
"FontLanguageOverride", "font-language-override",
products="gecko", "FontLanguageOverride",
initial_value="computed::FontLanguageOverride::zero()", products="gecko",
initial_specified_value="specified::FontLanguageOverride::normal()", initial_value="computed::FontLanguageOverride::zero()",
animation_value_type="discrete", initial_specified_value="specified::FontLanguageOverride::normal()",
extra_prefixes="moz:layout.css.prefixes.font-features", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", extra_prefixes="moz:layout.css.prefixes.font-features",
spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-language-override")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-language-override",
)}
${helpers.single_keyword_system("font-optical-sizing", ${helpers.single_keyword_system(
"auto none", "font-optical-sizing",
products="gecko", "auto none",
gecko_pref="layout.css.font-variations.enabled", products="gecko",
gecko_ffi_name="mFont.opticalSizing", gecko_pref="layout.css.font-variations.enabled",
gecko_constant_prefix="NS_FONT_OPTICAL_SIZING", gecko_ffi_name="mFont.opticalSizing",
animation_value_type="discrete", gecko_constant_prefix="NS_FONT_OPTICAL_SIZING",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", animation_value_type="discrete",
spec="https://www.w3.org/TR/css-fonts-4/#font-optical-sizing-def")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://www.w3.org/TR/css-fonts-4/#font-optical-sizing-def",
)}
${helpers.predefined_type("-x-lang", ${helpers.predefined_type(
"XLang", "-x-lang",
products="gecko", "XLang",
initial_value="computed::XLang::get_initial_value()", products="gecko",
animation_value_type="none", initial_value="computed::XLang::get_initial_value()",
enabled_in="", animation_value_type="none",
spec="Internal (not web-exposed)")} enabled_in="",
spec="Internal (not web-exposed)",
)}
${helpers.predefined_type("-moz-script-size-multiplier", ${helpers.predefined_type(
"MozScriptSizeMultiplier", "-moz-script-size-multiplier",
products="gecko", "MozScriptSizeMultiplier",
initial_value="computed::MozScriptSizeMultiplier::get_initial_value()", products="gecko",
animation_value_type="none", initial_value="computed::MozScriptSizeMultiplier::get_initial_value()",
gecko_ffi_name="mScriptSizeMultiplier", animation_value_type="none",
enabled_in="", gecko_ffi_name="mScriptSizeMultiplier",
spec="Internal (not web-exposed)")} enabled_in="",
spec="Internal (not web-exposed)",
)}
${helpers.predefined_type("-moz-script-level", ${helpers.predefined_type(
"MozScriptLevel", "-moz-script-level",
0, "MozScriptLevel",
animation_value_type="none", 0,
products="gecko", animation_value_type="none",
enabled_in="ua", products="gecko",
gecko_ffi_name="mScriptLevel", enabled_in="ua",
spec="Internal (not web-exposed)")} gecko_ffi_name="mScriptLevel",
spec="Internal (not web-exposed)",
)}
${helpers.single_keyword("-moz-math-display", ${helpers.single_keyword(
"inline block", "-moz-math-display",
gecko_constant_prefix="NS_MATHML_DISPLAYSTYLE", "inline block",
gecko_ffi_name="mMathDisplay", gecko_constant_prefix="NS_MATHML_DISPLAYSTYLE",
products="gecko", gecko_ffi_name="mMathDisplay",
enabled_in="ua", products="gecko",
spec="Internal (not web-exposed)", enabled_in="ua",
animation_value_type="none")} spec="Internal (not web-exposed)",
animation_value_type="none",
)}
${helpers.single_keyword("-moz-math-variant", ${helpers.single_keyword(
"""none normal bold italic bold-italic script bold-script "-moz-math-variant",
fraktur double-struck bold-fraktur sans-serif """none normal bold italic bold-italic script bold-script
bold-sans-serif sans-serif-italic sans-serif-bold-italic fraktur double-struck bold-fraktur sans-serif
monospace initial tailed looped stretched""", bold-sans-serif sans-serif-italic sans-serif-bold-italic
gecko_constant_prefix="NS_MATHML_MATHVARIANT", monospace initial tailed looped stretched""",
gecko_ffi_name="mMathVariant", gecko_constant_prefix="NS_MATHML_MATHVARIANT",
products="gecko", gecko_ffi_name="mMathVariant",
spec="Internal (not web-exposed)", products="gecko",
animation_value_type="none", spec="Internal (not web-exposed)",
enabled_in="", animation_value_type="none",
needs_conversion=True)} enabled_in="",
needs_conversion=True,
)}
${helpers.predefined_type("-moz-script-min-size", ${helpers.predefined_type(
"MozScriptMinSize", "-moz-script-min-size",
"specified::MozScriptMinSize::get_initial_value()", "MozScriptMinSize",
animation_value_type="none", "specified::MozScriptMinSize::get_initial_value()",
products="gecko", animation_value_type="none",
enabled_in="", products="gecko",
gecko_ffi_name="mScriptMinSize", enabled_in="",
spec="Internal (not web-exposed)")} gecko_ffi_name="mScriptMinSize",
spec="Internal (not web-exposed)",
)}
${helpers.predefined_type("-x-text-zoom", ${helpers.predefined_type(
"XTextZoom", "-x-text-zoom",
"computed::XTextZoom(true)", "XTextZoom",
animation_value_type="none", "computed::XTextZoom(true)",
products="gecko", animation_value_type="none",
enabled_in="", products="gecko",
spec="Internal (not web-exposed)")} enabled_in="",
spec="Internal (not web-exposed)",
)}
% if product == "gecko": % if product == "gecko":
pub mod system_font { pub mod system_font {
@ -462,29 +506,35 @@ ${helpers.predefined_type("-x-text-zoom",
} }
% endif % endif
${helpers.single_keyword("-moz-osx-font-smoothing", ${helpers.single_keyword(
"auto grayscale", "-moz-osx-font-smoothing",
gecko_constant_prefix="NS_FONT_SMOOTHING", "auto grayscale",
gecko_ffi_name="mFont.smoothing", gecko_constant_prefix="NS_FONT_SMOOTHING",
gecko_pref="layout.css.osx-font-smoothing.enabled", gecko_ffi_name="mFont.smoothing",
products="gecko", gecko_pref="layout.css.osx-font-smoothing.enabled",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth)", products="gecko",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth)",
animation_value_type="discrete")} flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
animation_value_type="discrete",
)}
${helpers.predefined_type("-moz-font-smoothing-background-color", ${helpers.predefined_type(
"RGBAColor", "-moz-font-smoothing-background-color",
"RGBA::transparent()", "RGBAColor",
animation_value_type="AnimatedRGBA", "RGBA::transparent()",
products="gecko", animation_value_type="AnimatedRGBA",
gecko_ffi_name="mFont.fontSmoothingBackgroundColor", products="gecko",
enabled_in="chrome", gecko_ffi_name="mFont.fontSmoothingBackgroundColor",
spec="None (Nonstandard internal property)")} enabled_in="chrome",
spec="None (Nonstandard internal property)",
)}
${helpers.predefined_type("-moz-min-font-size-ratio", ${helpers.predefined_type(
"Percentage", "-moz-min-font-size-ratio",
"computed::Percentage::hundred()", "Percentage",
animation_value_type="none", "computed::Percentage::hundred()",
products="gecko", animation_value_type="none",
enabled_in="ua", products="gecko",
spec="Nonstandard (Internal-only)")} enabled_in="ua",
spec="Nonstandard (Internal-only)",
)}