mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Rename LengthOrPercentage to LengthPercentage.
It does not represent `<length> | <percentage>`, but `<length-percentage>`, so `LengthOrPercentage` is not the right name. This patch is totally autogenerated using: rg 'LengthOrPercentage' servo | cut -d : -f 1 | sort | uniq > files for file in $(cat files); do sed -i "s#LengthOrPercentage#LengthPercentage#g" $file; done Differential Revision: https://phabricator.services.mozilla.com/D15812
This commit is contained in:
parent
4a31509215
commit
daf1f02feb
61 changed files with 709 additions and 702 deletions
|
@ -7,7 +7,7 @@
|
|||
//!
|
||||
//! [position]: https://drafts.csswg.org/css-backgrounds-3/#position
|
||||
|
||||
use crate::values::computed::{Integer, LengthOrPercentage, Percentage};
|
||||
use crate::values::computed::{Integer, LengthPercentage, Percentage};
|
||||
use crate::values::generics::position::Position as GenericPosition;
|
||||
use crate::values::generics::position::ZIndex as GenericZIndex;
|
||||
pub use crate::values::specified::position::{GridAutoFlow, GridTemplateAreas};
|
||||
|
@ -18,25 +18,25 @@ use style_traits::{CssWriter, ToCss};
|
|||
pub type Position = GenericPosition<HorizontalPosition, VerticalPosition>;
|
||||
|
||||
/// The computed value of a CSS horizontal position.
|
||||
pub type HorizontalPosition = LengthOrPercentage;
|
||||
pub type HorizontalPosition = LengthPercentage;
|
||||
|
||||
/// The computed value of a CSS vertical position.
|
||||
pub type VerticalPosition = LengthOrPercentage;
|
||||
pub type VerticalPosition = LengthPercentage;
|
||||
|
||||
impl Position {
|
||||
/// `50% 50%`
|
||||
#[inline]
|
||||
pub fn center() -> Self {
|
||||
Self::new(
|
||||
LengthOrPercentage::new_percent(Percentage(0.5)),
|
||||
LengthOrPercentage::new_percent(Percentage(0.5)),
|
||||
LengthPercentage::new_percent(Percentage(0.5)),
|
||||
LengthPercentage::new_percent(Percentage(0.5)),
|
||||
)
|
||||
}
|
||||
|
||||
/// `0% 0%`
|
||||
#[inline]
|
||||
pub fn zero() -> Self {
|
||||
Self::new(LengthOrPercentage::zero(), LengthOrPercentage::zero())
|
||||
Self::new(LengthPercentage::zero(), LengthPercentage::zero())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue