mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
box_: Remove unused code that resurfaced with the Rust upgrade
This commit is contained in:
parent
6720b8110a
commit
b34b42c94f
1 changed files with 0 additions and 72 deletions
|
@ -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
|
/// Transforms this box into another box of the given type, with the given size, preserving all
|
||||||
/// the other data.
|
/// the other data.
|
||||||
pub fn transform(&self, size: Size2D<Au>, specific: SpecificBoxInfo) -> Box {
|
pub fn transform(&self, size: Size2D<Au>, specific: SpecificBoxInfo) -> Box {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue