mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Make computed types hold Percentage instead of bare CSSFloat
This commit is contained in:
parent
4b633c8637
commit
608e7f71a2
22 changed files with 140 additions and 110 deletions
|
@ -11,6 +11,7 @@ use std::fmt;
|
|||
use style_traits::ToCss;
|
||||
use values::computed::LengthOrPercentage;
|
||||
use values::generics::position::Position as GenericPosition;
|
||||
use values::specified::length::Percentage;
|
||||
|
||||
/// The computed value of a CSS `<position>`
|
||||
pub type Position = GenericPosition<HorizontalPosition, VerticalPosition>;
|
||||
|
@ -25,7 +26,10 @@ impl Position {
|
|||
/// `50% 50%`
|
||||
#[inline]
|
||||
pub fn center() -> Self {
|
||||
Self::new(LengthOrPercentage::Percentage(0.5), LengthOrPercentage::Percentage(0.5))
|
||||
Self::new(
|
||||
LengthOrPercentage::Percentage(Percentage(0.5)),
|
||||
LengthOrPercentage::Percentage(Percentage(0.5)),
|
||||
)
|
||||
}
|
||||
|
||||
/// `0% 0%`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue