Make use of predefined_type for some aliased types

This commit is contained in:
Ravi Shankar 2017-04-16 12:42:29 +05:30
parent 61a17993eb
commit 63965f55f5
8 changed files with 81 additions and 174 deletions

View file

@ -219,6 +219,18 @@ impl ToComputedValue for HorizontalPosition {
}
}
impl HorizontalPosition {
#[inline]
/// Initial specified value for vertical position (`top` keyword).
pub fn left() -> HorizontalPosition {
GenericHorizontalPosition(PositionValue {
keyword: Some(Keyword::Left),
position: None,
})
}
}
/// The specified value of vertical `<position>`
pub type VerticalPosition = GenericVerticalPosition<PositionValue<LengthOrPercentage>>;
@ -238,3 +250,14 @@ impl ToComputedValue for VerticalPosition {
})
}
}
impl VerticalPosition {
#[inline]
/// Initial specified value for vertical position (`top` keyword).
pub fn top() -> VerticalPosition {
GenericVerticalPosition(PositionValue {
keyword: Some(Keyword::Top),
position: None,
})
}
}