From 69f4c38008d0139a090a4845dd56057ff14d56a0 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 11 Dec 2013 22:00:41 -0800 Subject: [PATCH] layout: Remove unused `content_box_width` field from `Box`. Shaves 4 bytes off the size of `Box`. --- src/components/main/layout/box.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/components/main/layout/box.rs b/src/components/main/layout/box.rs index 0280b646e58..25065929681 100644 --- a/src/components/main/layout/box.rs +++ b/src/components/main/layout/box.rs @@ -74,9 +74,6 @@ pub struct Box { /// The margin of the content box. margin: Slot>, - /// The width of the content box. - content_box_width: Au, - /// Info specific to the kind of box. Keep this enum small. specific: SpecificBoxInfo, } @@ -218,7 +215,6 @@ impl Box { border: Slot::init(Zero::zero()), padding: Slot::init(Zero::zero()), margin: Slot::init(Zero::zero()), - content_box_width: Zero::zero(), specific: specific, } } @@ -240,7 +236,6 @@ impl Box { border: Slot::init(self.border.get()), padding: Slot::init(self.padding.get()), margin: Slot::init(self.margin.get()), - content_box_width: self.content_box_width, specific: specific, } } @@ -313,7 +308,9 @@ impl Box { 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 { specified(padding, content_box_width) }