mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Implement transform: perspective(none)
Differential Revision: https://phabricator.services.mozilla.com/D123350
This commit is contained in:
parent
ce45f68d9c
commit
fa840e1666
4 changed files with 72 additions and 19 deletions
|
@ -238,8 +238,14 @@ impl Transform {
|
|||
Ok(generic::TransformOperation::SkewY(theta))
|
||||
},
|
||||
"perspective" => {
|
||||
let d = specified::Length::parse_non_negative(context, input)?;
|
||||
Ok(generic::TransformOperation::Perspective(d))
|
||||
let p = match input.try_parse(|input| specified::Length::parse_non_negative(context, input)) {
|
||||
Ok(p) => generic::PerspectiveFunction::Length(p),
|
||||
Err(..) => {
|
||||
input.expect_ident_matching("none")?;
|
||||
generic::PerspectiveFunction::None
|
||||
}
|
||||
};
|
||||
Ok(generic::TransformOperation::Perspective(p))
|
||||
},
|
||||
_ => Err(()),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue