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:
Emilio Cobos Álvarez 2019-01-07 12:20:30 +01:00
parent 4a31509215
commit daf1f02feb
61 changed files with 709 additions and 702 deletions

View file

@ -142,28 +142,28 @@ impl<ColorType: Parse, UrlPaintServer: Parse> Parse for SVGPaint<ColorType, UrlP
ToComputedValue,
ToCss,
)]
pub enum SvgLengthOrPercentageOrNumber<LengthOrPercentage, Number> {
pub enum SvgLengthPercentageOrNumber<LengthPercentage, Number> {
/// <length> | <percentage>
LengthOrPercentage(LengthOrPercentage),
LengthPercentage(LengthPercentage),
/// <number>
Number(Number),
}
/// Parsing the SvgLengthOrPercentageOrNumber. At first, we need to parse number
/// Parsing the SvgLengthPercentageOrNumber. At first, we need to parse number
/// since prevent converting to the length.
impl<LengthOrPercentageType: Parse, NumberType: Parse> Parse
for SvgLengthOrPercentageOrNumber<LengthOrPercentageType, NumberType>
impl<LengthPercentageType: Parse, NumberType: Parse> Parse
for SvgLengthPercentageOrNumber<LengthPercentageType, NumberType>
{
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
if let Ok(num) = input.try(|i| NumberType::parse(context, i)) {
return Ok(SvgLengthOrPercentageOrNumber::Number(num));
return Ok(SvgLengthPercentageOrNumber::Number(num));
}
let lop = LengthOrPercentageType::parse(context, input)?;
Ok(SvgLengthOrPercentageOrNumber::LengthOrPercentage(lop))
let lop = LengthPercentageType::parse(context, input)?;
Ok(SvgLengthPercentageOrNumber::LengthPercentage(lop))
}
}