Bug 1454294 - Rename alias to aliases in Longhand and Shorthand r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D105810
This commit is contained in:
Emily McDonough 2021-02-19 18:29:33 +00:00
Родитель 052e5ac04a
Коммит 59e9b91289
11 изменённых файлов: 32 добавлений и 32 удалений

Просмотреть файл

@ -234,7 +234,7 @@ class Property(object):
gecko_pref,
enabled_in,
rule_types_allowed,
alias,
aliases,
extra_prefixes,
flags,
):
@ -257,7 +257,7 @@ class Property(object):
# modulo a pref, set via servo_pref / gecko_pref.
assert enabled_in in ("", "ua", "chrome", "content")
self.enabled_in = enabled_in
self.alias = parse_property_aliases(alias)
self.aliases = parse_property_aliases(aliases)
self.extra_prefixes = parse_property_aliases(extra_prefixes)
self.flags = flags.split() if flags else []
@ -304,7 +304,7 @@ class Longhand(Property):
cast_type="u8",
logical=False,
logical_group=None,
alias=None,
aliases=None,
extra_prefixes=None,
boxed=False,
flags=None,
@ -323,7 +323,7 @@ class Longhand(Property):
gecko_pref=gecko_pref,
enabled_in=enabled_in,
rule_types_allowed=rule_types_allowed,
alias=alias,
aliases=aliases,
extra_prefixes=extra_prefixes,
flags=flags,
)
@ -538,7 +538,7 @@ class Shorthand(Property):
gecko_pref=None,
enabled_in="content",
rule_types_allowed=DEFAULT_RULES,
alias=None,
aliases=None,
extra_prefixes=None,
flags=None,
):
@ -551,7 +551,7 @@ class Shorthand(Property):
gecko_pref=gecko_pref,
enabled_in=enabled_in,
rule_types_allowed=rule_types_allowed,
alias=alias,
aliases=aliases,
extra_prefixes=extra_prefixes,
flags=flags,
)
@ -687,7 +687,7 @@ class PropertiesData(object):
# See servo/servo#14941.
if self.engine == "gecko":
for (prefix, pref) in property.extra_prefixes:
property.alias.append(("-%s-%s" % (prefix, property.name), pref))
property.aliases.append(("-%s-%s" % (prefix, property.name), pref))
def declare_longhand(self, name, engines=None, **kwargs):
engines = engines.split()
@ -696,8 +696,8 @@ class PropertiesData(object):
longhand = Longhand(self.current_style_struct, name, **kwargs)
self.add_prefixed_aliases(longhand)
longhand.alias = [Alias(xp[0], longhand, xp[1]) for xp in longhand.alias]
self.longhand_aliases += longhand.alias
longhand.aliases = [Alias(xp[0], longhand, xp[1]) for xp in longhand.aliases]
self.longhand_aliases += longhand.aliases
self.current_style_struct.longhands.append(longhand)
self.longhands.append(longhand)
self.longhands_by_name[name] = longhand
@ -716,8 +716,8 @@ class PropertiesData(object):
sub_properties = [self.longhands_by_name[s] for s in sub_properties]
shorthand = Shorthand(name, sub_properties, *args, **kwargs)
self.add_prefixed_aliases(shorthand)
shorthand.alias = [Alias(xp[0], shorthand, xp[1]) for xp in shorthand.alias]
self.shorthand_aliases += shorthand.alias
shorthand.aliases = [Alias(xp[0], shorthand, xp[1]) for xp in shorthand.aliases]
self.shorthand_aliases += shorthand.aliases
self.shorthands.append(shorthand)
self.shorthands_by_name[name] = shorthand
return shorthand

Просмотреть файл

@ -24,7 +24,7 @@
"border-%s-color" % side_name, "Color",
"computed_value::T::currentcolor()",
engines="gecko servo-2013 servo-2020",
alias=maybe_moz_logical_alias(engine, side, "-moz-border-%s-color"),
aliases=maybe_moz_logical_alias(engine, side, "-moz-border-%s-color"),
spec=maybe_logical_spec(side, "color"),
animation_value_type="AnimatedColor",
logical=is_logical,
@ -37,7 +37,7 @@
"border-%s-style" % side_name, "BorderStyle",
"specified::BorderStyle::None",
engines="gecko servo-2013 servo-2020",
alias=maybe_moz_logical_alias(engine, side, "-moz-border-%s-style"),
aliases=maybe_moz_logical_alias(engine, side, "-moz-border-%s-style"),
spec=maybe_logical_spec(side, "style"),
animation_value_type="discrete" if not is_logical else "none",
logical=is_logical,
@ -50,7 +50,7 @@
"crate::values::computed::NonNegativeLength::new(3.)",
engines="gecko servo-2013 servo-2020",
computed_type="crate::values::computed::NonNegativeLength",
alias=maybe_moz_logical_alias(engine, side, "-moz-border-%s-width"),
aliases=maybe_moz_logical_alias(engine, side, "-moz-border-%s-width"),
spec=maybe_logical_spec(side, "width"),
animation_value_type="NonNegativeLength",
logical=is_logical,

Просмотреть файл

@ -505,7 +505,7 @@ ${helpers.predefined_type(
"BreakWithin",
"computed::BreakWithin::Auto",
engines="gecko",
alias="page-break-inside",
aliases="page-break-inside",
spec="https://drafts.csswg.org/css-break/#propdef-break-inside",
animation_value_type="discrete",
)}
@ -607,7 +607,7 @@ ${helpers.predefined_type(
"Appearance",
"computed::Appearance::None",
engines="gecko",
alias="-moz-appearance -webkit-appearance",
aliases="-moz-appearance -webkit-appearance",
spec="https://drafts.csswg.org/css-ui-4/#propdef-appearance",
animation_value_type="discrete",
gecko_ffi_name="mAppearance",

Просмотреть файл

@ -57,7 +57,7 @@ ${helpers.single_keyword(
gecko_ffi_name="mTextSizeAdjust",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-size-adjust/#adjustment-control",
alias="-webkit-text-size-adjust",
aliases="-webkit-text-size-adjust",
)}
${helpers.predefined_type(
@ -82,7 +82,7 @@ ${helpers.predefined_type(
servo_2020_pref="layout.2020.unimplemented",
animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap",
alias="word-wrap",
aliases="word-wrap",
servo_restyle_damage="rebuild_and_reflow",
)}

Просмотреть файл

@ -17,7 +17,7 @@
"LengthPercentageOrAuto",
"computed::LengthPercentageOrAuto::zero()",
engines="gecko servo-2013 servo-2020",
alias=maybe_moz_logical_alias(engine, side, "-moz-margin-%s"),
aliases=maybe_moz_logical_alias(engine, side, "-moz-margin-%s"),
allow_quirks="No" if side[1] else "Yes",
animation_value_type="ComputedValue",
logical=side[1],

Просмотреть файл

@ -17,7 +17,7 @@
"NonNegativeLengthPercentage",
"computed::NonNegativeLengthPercentage::zero()",
engines="gecko servo-2013 servo-2020",
alias=maybe_moz_logical_alias(engine, side, "-moz-padding-%s"),
aliases=maybe_moz_logical_alias(engine, side, "-moz-padding-%s"),
animation_value_type="NonNegativeLengthPercentage",
logical=side[1],
logical_group="padding",

Просмотреть файл

@ -432,7 +432,7 @@ ${helpers.predefined_type(
"length::NonNegativeLengthPercentageOrNormal",
"computed::length::NonNegativeLengthPercentageOrNormal::normal()",
engines="gecko servo-2013",
alias="grid-column-gap" if engine == "gecko" else "",
aliases="grid-column-gap" if engine == "gecko" else "",
extra_prefixes="moz:layout.css.prefixes.columns",
servo_2013_pref="layout.columns.enabled",
spec="https://drafts.csswg.org/css-align-3/#propdef-column-gap",
@ -446,7 +446,7 @@ ${helpers.predefined_type(
"length::NonNegativeLengthPercentageOrNormal",
"computed::length::NonNegativeLengthPercentageOrNormal::normal()",
engines="gecko",
alias="grid-row-gap",
aliases="grid-row-gap",
spec="https://drafts.csswg.org/css-align-3/#propdef-row-gap",
animation_value_type="NonNegativeLengthPercentageOrNormal",
servo_restyle_damage="reflow",

Просмотреть файл

@ -15,7 +15,7 @@ ${helpers.single_keyword(
gecko_ffi_name="mBoxAlign",
gecko_enum_prefix="StyleBoxAlign",
animation_value_type="discrete",
alias="-webkit-box-align",
aliases="-webkit-box-align",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-align)",
)}
@ -26,7 +26,7 @@ ${helpers.single_keyword(
gecko_ffi_name="mBoxDirection",
gecko_enum_prefix="StyleBoxDirection",
animation_value_type="discrete",
alias="-webkit-box-direction",
aliases="-webkit-box-direction",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-direction)",
)}
@ -37,7 +37,7 @@ ${helpers.predefined_type(
engines="gecko",
gecko_ffi_name="mBoxFlex",
animation_value_type="NonNegativeNumber",
alias="-webkit-box-flex",
aliases="-webkit-box-flex",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-flex)",
)}
@ -49,7 +49,7 @@ ${helpers.single_keyword(
gecko_aliases="inline-axis=horizontal block-axis=vertical",
gecko_enum_prefix="StyleBoxOrient",
animation_value_type="discrete",
alias="-webkit-box-orient",
aliases="-webkit-box-orient",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-orient)",
)}
@ -60,7 +60,7 @@ ${helpers.single_keyword(
gecko_ffi_name="mBoxPack",
gecko_enum_prefix="StyleBoxPack",
animation_value_type="discrete",
alias="-webkit-box-pack",
aliases="-webkit-box-pack",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/box-pack)",
)}
@ -72,7 +72,7 @@ ${helpers.predefined_type(
"1",
engines="gecko",
parse_method="parse_non_negative",
alias="-webkit-box-ordinal-group",
aliases="-webkit-box-ordinal-group",
gecko_ffi_name="mBoxOrdinal",
animation_value_type="discrete",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-box-ordinal-group)",

Просмотреть файл

@ -1948,7 +1948,7 @@ impl PropertyId {
% for (kind, properties) in [("Longhand", data.longhands), ("Shorthand", data.shorthands)]:
% for property in properties:
"${property.name}" => StaticId::${kind}(${kind}Id::${property.camel_case}),
% for alias in property.alias:
% for alias in property.aliases:
"${alias.name}" => {
StaticId::${kind}Alias(
${kind}Id::${property.camel_case},
@ -4089,7 +4089,7 @@ macro_rules! css_properties_accessors {
% for kind, props in [("Longhand", data.longhands), ("Shorthand", data.shorthands)]:
% for property in props:
% if property.enabled_in_content():
% for prop in [property] + property.alias:
% for prop in [property] + property.aliases:
% if '-' in prop.name:
[${prop.ident.capitalize()}, Set${prop.ident.capitalize()},
PropertyId::${kind}(${kind}Id::${property.camel_case})],

Просмотреть файл

@ -112,7 +112,7 @@ pub fn parse_border<'i, 't>(
'border-%s-%s' % (side, prop)
for prop in ['color', 'style', 'width']
)}"
alias="${maybe_moz_logical_alias(engine, (side, logical), '-moz-border-%s')}"
aliases="${maybe_moz_logical_alias(engine, (side, logical), '-moz-border-%s')}"
spec="${spec}">
pub fn parse_value<'i, 't>(

Просмотреть файл

@ -115,7 +115,7 @@
<%helpers:shorthand
name="gap"
engines="gecko"
alias="grid-gap"
aliases="grid-gap"
sub_properties="row-gap column-gap"
spec="https://drafts.csswg.org/css-align-3/#gap-shorthand"
>