mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Remove unused content_box_width
field from Box
.
Shaves 4 bytes off the size of `Box`.
This commit is contained in:
parent
500060a9e2
commit
69f4c38008
1 changed files with 3 additions and 6 deletions
|
@ -74,9 +74,6 @@ pub struct Box {
|
||||||
/// The margin of the content box.
|
/// The margin of the content box.
|
||||||
margin: Slot<SideOffsets2D<Au>>,
|
margin: Slot<SideOffsets2D<Au>>,
|
||||||
|
|
||||||
/// The width of the content box.
|
|
||||||
content_box_width: Au,
|
|
||||||
|
|
||||||
/// Info specific to the kind of box. Keep this enum small.
|
/// Info specific to the kind of box. Keep this enum small.
|
||||||
specific: SpecificBoxInfo,
|
specific: SpecificBoxInfo,
|
||||||
}
|
}
|
||||||
|
@ -218,7 +215,6 @@ impl Box {
|
||||||
border: Slot::init(Zero::zero()),
|
border: Slot::init(Zero::zero()),
|
||||||
padding: Slot::init(Zero::zero()),
|
padding: Slot::init(Zero::zero()),
|
||||||
margin: Slot::init(Zero::zero()),
|
margin: Slot::init(Zero::zero()),
|
||||||
content_box_width: Zero::zero(),
|
|
||||||
specific: specific,
|
specific: specific,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,7 +236,6 @@ impl Box {
|
||||||
border: Slot::init(self.border.get()),
|
border: Slot::init(self.border.get()),
|
||||||
padding: Slot::init(self.padding.get()),
|
padding: Slot::init(self.padding.get()),
|
||||||
margin: Slot::init(self.margin.get()),
|
margin: Slot::init(self.margin.get()),
|
||||||
content_box_width: self.content_box_width,
|
|
||||||
specific: specific,
|
specific: specific,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -313,7 +308,9 @@ impl Box {
|
||||||
self.padding.set(padding)
|
self.padding.set(padding)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn compute_padding_length(&self, padding: LengthOrPercentage, content_box_width: Au)
|
pub fn compute_padding_length(&self,
|
||||||
|
padding: LengthOrPercentage,
|
||||||
|
content_box_width: Au)
|
||||||
-> Au {
|
-> Au {
|
||||||
specified(padding, content_box_width)
|
specified(padding, content_box_width)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue