Skip to content

Commit b201993

Browse files
committed
[css-transforms-2] Specify serialization of translate/rotate/scale better.
1 parent b32d458 commit b201993

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

css-transforms-2/Overview.bs

+52
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,58 @@ When 'translate', 'rotate' or 'scale' are animating or transitioning, and the fr
650650
value (but not both) is ''translate/none'', the value ''translate/none'' is replaced by the equivalent identity
651651
value (''0px'' for translate, ''0deg'' for rotate, ''1'' for scale).
652652

653+
Serialization {#individual-transform-serialization}
654+
---------------------------------------------------
655+
656+
Because these properties have three distinct modes of behavior
657+
(no transform, 2d transform, or 3d transform),
658+
serialization must take this into account:
659+
660+
: for 'translate'
661+
:: If a 2d translation is specified,
662+
the property must serialize with only one or two values
663+
(per usual, if the second value is ''0px'', the default,
664+
it must be omitted when serializing).
665+
666+
If a 3d translation is specified,
667+
all three values must be serialized.
668+
669+
It must serialize as the keyword ''translate/none''
670+
if and only if ''translate/none'' was originally specified.
671+
(An identity transform does not count;
672+
it must serialize as the 2d or 3d version,
673+
as appropriate.)
674+
675+
: for 'rotate'
676+
:: If a 2d rotation is specified,
677+
the property must serialize as just an <<angle>>.
678+
679+
If a 3d rotation is specified,
680+
the property must serialize with an axis specified.
681+
If the axis is parallel with the x, y, or z axises,
682+
it must serialize as the appropriate keyword.
683+
684+
It must serialize as the keyword ''rotate/none''
685+
if and only if ''rotate/none'' was originally specified.
686+
(An identity transform does not count;
687+
it must serialize as the 2d or 3d version,
688+
as appropriate.)
689+
690+
: for 'scale'
691+
:: If a 2d scale is specified,
692+
the property must serialize with only one or two values
693+
(per usual, if the second value is the same as the first, the default,
694+
it must be omitted when serializing).
695+
696+
If a 3d scale is specified,
697+
all three values must be serialized.
698+
699+
It must serialize as the keyword ''scale/none''
700+
if and only if ''scale/none'' was originally specified.
701+
(An identity transform does not count;
702+
it must serialize as the 2d or 3d version,
703+
as appropriate.)
704+
653705
Current Transformation Matrix {#ctm}
654706
====================================
655707

0 commit comments

Comments
 (0)