style: Match rotate ops.

Per bug 1322189 we really should. I've copied the setup we have already for
translate / scale, but we should really clean this up a bit more I'd think.

In any case, probably skew should be matched as well...

Bug: 1464615
Reviewed-by: hiro
MozReview-Commit-ID: Jky5k8HVfuH
This commit is contained in:
Emilio Cobos Álvarez 2018-05-25 20:11:37 +02:00
parent 01f805af9f
commit 2e500d70ef
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 46 additions and 1 deletions

View file

@ -276,6 +276,19 @@ pub struct Transform<T>(#[css(if_empty = "none", iterable)] pub Vec<T>);
impl<Angle, Number, Length, Integer, LengthOrPercentage>
TransformOperation<Angle, Number, Length, Integer, LengthOrPercentage>
{
/// Check if it is any rotate function.
pub fn is_rotate(&self) -> bool {
use self::TransformOperation::*;
matches!(
*self,
Rotate(..) |
Rotate3D(..) |
RotateX(..) |
RotateY(..) |
RotateZ(..)
)
}
/// Check if it is any translate function
pub fn is_translate(&self) -> bool {
use self::TransformOperation::*;