mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
style: Deduplicate Angle parsing code.
This commit is contained in:
parent
55439e6222
commit
3631b1e197
3 changed files with 41 additions and 26 deletions
|
@ -714,6 +714,8 @@ impl LineDirection {
|
|||
let mut _angle = if *compat_mode == CompatMode::Moz {
|
||||
input.try(|i| Angle::parse(context, i)).ok()
|
||||
} else {
|
||||
// Gradients allow unitless zero angles as an exception, see:
|
||||
// https://github.com/w3c/csswg-drafts/issues/1162
|
||||
if let Ok(angle) = input.try(|i| Angle::parse_with_unitless(context, i)) {
|
||||
return Ok(LineDirection::Angle(angle));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue