mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Use Rect in InsetRect
This commit is contained in:
parent
6f3c46ca61
commit
150c9df246
6 changed files with 34 additions and 47 deletions
|
@ -128,17 +128,14 @@ impl InsetRect {
|
|||
/// Parse the inner function arguments of `inset()`
|
||||
pub fn parse_function_arguments(context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
||||
let rect = Rect::parse_with(context, input, LengthOrPercentage::parse)?;
|
||||
let round_rect = if input.try(|i| i.expect_ident_matching("round")).is_ok() {
|
||||
let round = if input.try(|i| i.expect_ident_matching("round")).is_ok() {
|
||||
Some(BorderRadius::parse(context, input)?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
Ok(GenericInsetRect {
|
||||
top: rect.top,
|
||||
right: rect.right,
|
||||
bottom: rect.bottom,
|
||||
left: rect.left,
|
||||
round: round_rect,
|
||||
rect: rect,
|
||||
round: round,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue