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:
Boris Chiou 2019-09-23 19:56:33 +00:00 committed by Emilio Cobos Álvarez
parent 3cb18071a2
commit 4a23556c4b
3 changed files with 95 additions and 2 deletions

View file

@ -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,