diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2014-04-15 14:50:14 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2014-04-15 14:50:14 -0700 |
commit | b34b42c94ff7b8610f168fceaafb7e3883a4cc59 (patch) | |
tree | 96292f4e579795c506f8109ef87bfdff3cd9890c /src | |
parent | 6720b8110a6dd88abee9e02faf49c399bed7e02f (diff) | |
download | servo-b34b42c94ff7b8610f168fceaafb7e3883a4cc59.tar.gz servo-b34b42c94ff7b8610f168fceaafb7e3883a4cc59.zip |
box_: Remove unused code that resurfaced with the Rust upgrade
Diffstat (limited to 'src')
-rw-r--r-- | src/components/main/layout/box_.rs | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/components/main/layout/box_.rs b/src/components/main/layout/box_.rs index ae9dc8ad381..9b57cc9795f 100644 --- a/src/components/main/layout/box_.rs +++ b/src/components/main/layout/box_.rs @@ -512,78 +512,6 @@ impl Box { } } - // CSS Section 10.6.4 - // We have to solve the constraint equation: - // top + bottom + height + (vertical border + padding) = height of - // containing block (`screen_height`) - // - // `y`: static position of the element - //TODO(ibnc) take into account padding. - pub fn get_y_coord_and_new_height_if_fixed(&self, - screen_height: Au, - mut height: Au, - mut y: Au, - is_fixed: bool) - -> (Au, Au) { - if is_fixed { - let position_offsets = self.position_offsets.get(); - match (position_offsets.top, position_offsets.bottom) { - (Au(0), Au(0)) => {} - (Au(0), _) => { - y = screen_height - position_offsets.bottom - height; - } - (_, Au(0)) => { - y = position_offsets.top; - } - (_, _) => { - y = position_offsets.top; - match MaybeAuto::from_style(self.style().Box.get().height, Au(0)) { - Auto => { - height = screen_height - position_offsets.top - position_offsets.bottom; - } - _ => {} - } - } - } - } - return (y, height); - } - - // CSS Section 10.3.7 - //TODO(ibnc) removing padding when width needs to be stretched. - pub fn get_x_coord_and_new_width_if_fixed(&self, - screen_width: Au, - screen_height: Au, - mut width: Au, - mut x: Au, - is_fixed: bool) - -> (Au, Au) { - if is_fixed { - self.compute_positioned_offsets(self.style(), screen_width, screen_height); - let position_offsets = self.position_offsets.get(); - - match (position_offsets.left, position_offsets.right) { - (Au(0), Au(0)) => {} - (_, Au(0)) => { - x = position_offsets.left; - } - (Au(0), _) => { - x = screen_width - position_offsets.right - width; - } - (_, _) => { - x = position_offsets.left; - match MaybeAuto::from_style(self.style().Box.get().width, Au(0)) { - Auto => { - width = screen_width - position_offsets.left - position_offsets.right; - } - _ => {} - } - } - } - } - return (x, width); - } - /// Transforms this box into another box of the given type, with the given size, preserving all /// the other data. pub fn transform(&self, size: Size2D<Au>, specific: SpecificBoxInfo) -> Box { |