mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Use less type aliases from longhands in PropertyDeclaration
This will help us reuse code between different variants in a later patch, to implement Clone by hand to optimise it.
This commit is contained in:
parent
e54935c25a
commit
90b37cfa21
1 changed files with 10 additions and 6 deletions
|
@ -1443,12 +1443,16 @@ impl PropertyId {
|
||||||
#[derive(Clone, PartialEq)]
|
#[derive(Clone, PartialEq)]
|
||||||
pub enum PropertyDeclaration {
|
pub enum PropertyDeclaration {
|
||||||
% for property in data.longhands:
|
% for property in data.longhands:
|
||||||
/// ${property.name}
|
/// ${property.name}
|
||||||
% if property.boxed:
|
<%
|
||||||
${property.camel_case}(Box<longhands::${property.ident}::SpecifiedValue>),
|
if property.predefined_type and not property.is_vector:
|
||||||
% else:
|
ty = "::values::specified::{}".format(property.predefined_type)
|
||||||
${property.camel_case}(longhands::${property.ident}::SpecifiedValue),
|
else:
|
||||||
% endif
|
ty = "longhands::{}::SpecifiedValue".format(property.ident)
|
||||||
|
if property.boxed:
|
||||||
|
ty = "Box<{}>".format(ty)
|
||||||
|
%>
|
||||||
|
${property.camel_case}(${ty}),
|
||||||
% endfor
|
% endfor
|
||||||
/// A css-wide keyword.
|
/// A css-wide keyword.
|
||||||
CSSWideKeyword(LonghandId, CSSWideKeyword),
|
CSSWideKeyword(LonghandId, CSSWideKeyword),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue