mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Derive parse for ShapeRadius.
Depends on D76331 Differential Revision: https://phabricator.services.mozilla.com/D76332
This commit is contained in:
parent
e259c53c62
commit
224550f818
2 changed files with 1 additions and 16 deletions
|
@ -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 {
|
||||
fn parse<'i, 't>(
|
||||
context: &ParserContext,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue