mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Auto merge of #18396 - jdm:codesize, r=emilio
Reduce duplication in generated ServoComputedData::to_declaration_block. This reduces the size of the code in libXUL by 23.4k according to bloaty. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18396) <!-- Reviewable:end -->
This commit is contained in:
commit
af587e5f84
1 changed files with 12 additions and 14 deletions
|
@ -342,11 +342,10 @@ impl ComputedValuesInner {
|
||||||
pub fn is_multicol(&self) -> bool { false }
|
pub fn is_multicol(&self) -> bool { false }
|
||||||
|
|
||||||
pub fn to_declaration_block(&self, property: PropertyDeclarationId) -> PropertyDeclarationBlock {
|
pub fn to_declaration_block(&self, property: PropertyDeclarationId) -> PropertyDeclarationBlock {
|
||||||
match property {
|
let value = match property {
|
||||||
% for prop in data.longhands:
|
% for prop in data.longhands:
|
||||||
% if prop.animatable:
|
% if prop.animatable:
|
||||||
PropertyDeclarationId::Longhand(LonghandId::${prop.camel_case}) => {
|
PropertyDeclarationId::Longhand(LonghandId::${prop.camel_case}) => {
|
||||||
PropertyDeclarationBlock::with_one(
|
|
||||||
PropertyDeclaration::${prop.camel_case}(
|
PropertyDeclaration::${prop.camel_case}(
|
||||||
% if prop.boxed:
|
% if prop.boxed:
|
||||||
Box::new(
|
Box::new(
|
||||||
|
@ -356,15 +355,14 @@ impl ComputedValuesInner {
|
||||||
% if prop.boxed:
|
% if prop.boxed:
|
||||||
)
|
)
|
||||||
% endif
|
% endif
|
||||||
),
|
|
||||||
Importance::Normal
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
PropertyDeclarationId::Custom(_name) => unimplemented!(),
|
PropertyDeclarationId::Custom(_name) => unimplemented!(),
|
||||||
_ => unimplemented!()
|
_ => unimplemented!()
|
||||||
}
|
};
|
||||||
|
PropertyDeclarationBlock::with_one(value, Importance::Normal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue