mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Put alias instances into {longhand,shorthand}.alias.
This commit is contained in:
parent
9a900ef019
commit
2aee174b6d
2 changed files with 15 additions and 13 deletions
|
@ -460,7 +460,8 @@ class PropertiesData(object):
|
||||||
|
|
||||||
longhand = Longhand(self.current_style_struct, name, **kwargs)
|
longhand = Longhand(self.current_style_struct, name, **kwargs)
|
||||||
self.add_prefixed_aliases(longhand)
|
self.add_prefixed_aliases(longhand)
|
||||||
self.longhand_aliases += list(map(lambda x: Alias(x, longhand), longhand.alias))
|
longhand.alias = list(map(lambda x: Alias(x, longhand), longhand.alias))
|
||||||
|
self.longhand_aliases += longhand.alias
|
||||||
self.current_style_struct.longhands.append(longhand)
|
self.current_style_struct.longhands.append(longhand)
|
||||||
self.longhands.append(longhand)
|
self.longhands.append(longhand)
|
||||||
self.longhands_by_name[name] = longhand
|
self.longhands_by_name[name] = longhand
|
||||||
|
@ -475,7 +476,8 @@ class PropertiesData(object):
|
||||||
sub_properties = [self.longhands_by_name[s] for s in sub_properties]
|
sub_properties = [self.longhands_by_name[s] for s in sub_properties]
|
||||||
shorthand = Shorthand(name, sub_properties, *args, **kwargs)
|
shorthand = Shorthand(name, sub_properties, *args, **kwargs)
|
||||||
self.add_prefixed_aliases(shorthand)
|
self.add_prefixed_aliases(shorthand)
|
||||||
self.shorthand_aliases += list(map(lambda x: Alias(x, shorthand), shorthand.alias))
|
shorthand.alias = list(map(lambda x: Alias(x, shorthand), shorthand.alias))
|
||||||
|
self.shorthand_aliases += shorthand.alias
|
||||||
self.shorthands.append(shorthand)
|
self.shorthands.append(shorthand)
|
||||||
return shorthand
|
return shorthand
|
||||||
|
|
||||||
|
|
|
@ -1578,10 +1578,10 @@ impl PropertyId {
|
||||||
% for (kind, properties) in [("Longhand", data.longhands), ("Shorthand", data.shorthands)]:
|
% for (kind, properties) in [("Longhand", data.longhands), ("Shorthand", data.shorthands)]:
|
||||||
% for property in properties:
|
% for property in properties:
|
||||||
"${property.name}" => StaticId::${kind}(${kind}Id::${property.camel_case}),
|
"${property.name}" => StaticId::${kind}(${kind}Id::${property.camel_case}),
|
||||||
% for name in property.alias:
|
% for alias in property.alias:
|
||||||
"${name}" => {
|
"${alias.name}" => {
|
||||||
StaticId::${kind}Alias(${kind}Id::${property.camel_case},
|
StaticId::${kind}Alias(${kind}Id::${property.camel_case},
|
||||||
AliasId::${to_camel_case(name)})
|
AliasId::${alias.camel_case})
|
||||||
},
|
},
|
||||||
% endfor
|
% endfor
|
||||||
% endfor
|
% endfor
|
||||||
|
@ -1621,10 +1621,10 @@ impl PropertyId {
|
||||||
Ok(PropertyId::Longhand(LonghandId::${property.camel_case}))
|
Ok(PropertyId::Longhand(LonghandId::${property.camel_case}))
|
||||||
}
|
}
|
||||||
% for alias in property.alias:
|
% for alias in property.alias:
|
||||||
${helpers.alias_to_nscsspropertyid(alias)} => {
|
${helpers.alias_to_nscsspropertyid(alias.name)} => {
|
||||||
Ok(PropertyId::LonghandAlias(
|
Ok(PropertyId::LonghandAlias(
|
||||||
LonghandId::${property.camel_case},
|
LonghandId::${property.camel_case},
|
||||||
AliasId::${to_camel_case(alias)}
|
AliasId::${alias.camel_case}
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
% endfor
|
% endfor
|
||||||
|
@ -1634,10 +1634,10 @@ impl PropertyId {
|
||||||
Ok(PropertyId::Shorthand(ShorthandId::${property.camel_case}))
|
Ok(PropertyId::Shorthand(ShorthandId::${property.camel_case}))
|
||||||
}
|
}
|
||||||
% for alias in property.alias:
|
% for alias in property.alias:
|
||||||
${helpers.alias_to_nscsspropertyid(alias)} => {
|
${helpers.alias_to_nscsspropertyid(alias.name)} => {
|
||||||
Ok(PropertyId::ShorthandAlias(
|
Ok(PropertyId::ShorthandAlias(
|
||||||
ShorthandId::${property.camel_case},
|
ShorthandId::${property.camel_case},
|
||||||
AliasId::${to_camel_case(alias)}
|
AliasId::${alias.camel_case}
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
% endfor
|
% endfor
|
||||||
|
@ -3868,12 +3868,12 @@ macro_rules! css_properties_accessors {
|
||||||
% for kind, props in [("Longhand", data.longhands), ("Shorthand", data.shorthands)]:
|
% for kind, props in [("Longhand", data.longhands), ("Shorthand", data.shorthands)]:
|
||||||
% for property in props:
|
% for property in props:
|
||||||
% if property.enabled_in_content():
|
% if property.enabled_in_content():
|
||||||
% for name in [property.name] + property.alias:
|
% for prop in [property] + property.alias:
|
||||||
% if '-' in name:
|
% if '-' in prop.name:
|
||||||
[${to_rust_ident(name).capitalize()}, Set${to_rust_ident(name).capitalize()},
|
[${prop.ident.capitalize()}, Set${prop.ident.capitalize()},
|
||||||
PropertyId::${kind}(${kind}Id::${property.camel_case})],
|
PropertyId::${kind}(${kind}Id::${property.camel_case})],
|
||||||
% endif
|
% endif
|
||||||
[${to_camel_case(name)}, Set${to_camel_case(name)},
|
[${prop.camel_case}, Set${prop.camel_case},
|
||||||
PropertyId::${kind}(${kind}Id::${property.camel_case})],
|
PropertyId::${kind}(${kind}Id::${property.camel_case})],
|
||||||
% endfor
|
% endfor
|
||||||
% endif
|
% endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue