mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #15065 - Manishearth:box-calclop, r=heycam
Use Box<CalcLengthOrPercentage> in specified values to avoid bloating inline sizes For #15061 CalcLOP is a large struct, and gets used quite often. While #15063 reduces its size a bit, it will still be much larger than any of the other variants in the `specified::Length*` types, so it will still bloat sizes, especially for specified values that contain many lengths. This change boxes it in the length types, so that it just takes one word. r? @heycam <!-- 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/15065) <!-- Reviewable:end -->
This commit is contained in:
commit
f010fb58fd
20 changed files with 280 additions and 249 deletions
|
@ -480,7 +480,7 @@ impl LayoutElementHelpers for LayoutJS<Element> {
|
|||
hints.push(from_declaration(
|
||||
PropertyDeclaration::BorderSpacing(DeclaredValue::Value(
|
||||
border_spacing::SpecifiedValue {
|
||||
horizontal: width_value,
|
||||
horizontal: width_value.clone(),
|
||||
vertical: width_value,
|
||||
}))));
|
||||
}
|
||||
|
@ -625,11 +625,11 @@ impl LayoutElementHelpers for LayoutJS<Element> {
|
|||
let width_value = specified::BorderWidth::from_length(
|
||||
specified::Length::Absolute(Au::from_px(border as i32)));
|
||||
hints.push(from_declaration(
|
||||
PropertyDeclaration::BorderTopWidth(DeclaredValue::Value(width_value))));
|
||||
PropertyDeclaration::BorderTopWidth(DeclaredValue::Value(width_value.clone()))));
|
||||
hints.push(from_declaration(
|
||||
PropertyDeclaration::BorderLeftWidth(DeclaredValue::Value(width_value))));
|
||||
PropertyDeclaration::BorderLeftWidth(DeclaredValue::Value(width_value.clone()))));
|
||||
hints.push(from_declaration(
|
||||
PropertyDeclaration::BorderBottomWidth(DeclaredValue::Value(width_value))));
|
||||
PropertyDeclaration::BorderBottomWidth(DeclaredValue::Value(width_value.clone()))));
|
||||
hints.push(from_declaration(
|
||||
PropertyDeclaration::BorderRightWidth(DeclaredValue::Value(width_value))));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue