Skip to content

Commit

Permalink
auto merge of #2119 : pcwalton/servo/rm-unused-code, r=pcwalton
Browse files Browse the repository at this point in the history
trivial
  • Loading branch information
bors-servo committed Apr 15, 2014
2 parents 038730c + b34b42c commit 896cadb
Showing 1 changed file with 0 additions and 72 deletions.
72 changes: 0 additions & 72 deletions src/components/main/layout/box_.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit 896cadb

Please sign in to comment.