style: Derive parse for ShapeRadius.

Depends on D76331

Differential Revision: https://phabricator.services.mozilla.com/D76332
This commit is contained in:
Emilio Cobos Álvarez 2020-05-21 18:43:12 +00:00
parent e259c53c62
commit 224550f818
2 changed files with 1 additions and 16 deletions

View file

@ -270,6 +270,7 @@ pub struct Ellipse<H, V, NonNegativeLengthPercentage> {
Copy, Copy,
Debug, Debug,
MallocSizeOf, MallocSizeOf,
Parse,
PartialEq, PartialEq,
SpecifiedValueInfo, SpecifiedValueInfo,
ToAnimatedValue, ToAnimatedValue,

View file

@ -263,22 +263,6 @@ impl Ellipse {
} }
} }
impl Parse for ShapeRadius {
fn parse<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Self, ParseError<'i>> {
if let Ok(lp) = input.try(|i| NonNegativeLengthPercentage::parse(context, i)) {
return Ok(generic::ShapeRadius::Length(lp));
}
try_match_ident_ignore_ascii_case! { input,
"closest-side" => Ok(generic::ShapeRadius::ClosestSide),
"farthest-side" => Ok(generic::ShapeRadius::FarthestSide),
}
}
}
impl Parse for Polygon { impl Parse for Polygon {
fn parse<'i, 't>( fn parse<'i, 't>(
context: &ParserContext, context: &ParserContext,