mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Add offset shorthand.
Also, update the serialization by the shorter perference because this is a new feature and using older syntax doesn't make sense. Besides, use `cssOffset` for web animation IDL attribute name. Differential Revision: https://phabricator.services.mozilla.com/D45607
This commit is contained in:
parent
3cb18071a2
commit
4a23556c4b
3 changed files with 95 additions and 2 deletions
|
@ -130,6 +130,23 @@ pub struct OffsetRotate {
|
|||
angle: Angle,
|
||||
}
|
||||
|
||||
impl OffsetRotate {
|
||||
/// Returns the initial value, auto.
|
||||
#[inline]
|
||||
pub fn auto() -> Self {
|
||||
OffsetRotate {
|
||||
direction: OffsetRotateDirection::Auto,
|
||||
angle: Angle::zero(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if self is auto 0deg.
|
||||
#[inline]
|
||||
pub fn is_auto(&self) -> bool {
|
||||
self.direction == OffsetRotateDirection::Auto && self.angle.is_zero()
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for OffsetRotate {
|
||||
fn parse<'i, 't>(
|
||||
context: &ParserContext,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue