diff --git a/css-transforms-2/Overview.bs b/css-transforms-2/Overview.bs index 640c089f0fe..23505d211aa 100644 --- a/css-transforms-2/Overview.bs +++ b/css-transforms-2/Overview.bs @@ -34,6 +34,12 @@ spec:css-transforms-1; text: type: function; text: matrix() +spec:css2; + type: dfn; + text: stacking context +spec: infra + type:dfn; + text: list spec: filter-effects-1; type:property; text:filter; spec: html; type: element; text: a; @@ -62,7 +68,7 @@ Module Interactions {#module-interactions} The 3D transform functions here extend the set of functions for the 'transform' property. -Some values of 'perspective', 'transform-style' and 'backface-visibility' result in the creation of a [=containing block for all descendants=], and/or the creation of a stacking context. +Some values of 'perspective', 'transform-style' and 'backface-visibility' result in the creation of a [=containing block for all descendants=], and/or the creation of a stacking context. Three-dimensional transforms affect the visual layering of elements, and thus override the back-to-front painting order described in Appendix E of [[!CSS21]]. @@ -70,7 +76,7 @@ Three-dimensional transforms affect the visual layering of elements, and thus ov Terminology {#terminology} ========================== -: 3D-transformed element +: 3D transformed element :: An element whose computed value for the 'transform' property includes one of the 3D transform functions : 3D matrix @@ -274,16 +280,16 @@ The rendering of elements in a 3D rendering context is as follows (numbers refer
  • The content and descendant elements without 3D transforms, ordered according to steps 3—7, are rendered into a plane at z=0 relative to to the establishing element.
  • 3D-transformed elements are each rendered into their own plane, transformed by the accumulated 3D transformation matrix.
  • Intersection is performed between the set of planes generated by steps B and C, according to Newell's algorithm. -
  • The resulting set of planes is rendered on top of the backgrounds and box decorations rendered in this step A. Coplanar 3D transformed elements are rendered in painting order. +
  • The resulting set of planes is rendered on top of the backgrounds and box decorations rendered in this step A. Coplanar [=3D transformed elements=] are rendered in painting order. Issue: is it OK to not pop 2D-transformed elements into their own planes? Issue: requiring intersection with non-transformed content and descendants requires UAs to allocate additional textures (possibly doubling memory use). Would be more efficient to simply render content and untransformed descendants along with background and borders. -Note that elements with transforms which have a negative z-component will render behind the content and untransformed descendants of the establishing element, and that 3D transformed elements may interpenetrate with content and untransformed elements. +Note that elements with transforms which have a negative z-component will render behind the content and untransformed descendants of the establishing element, and that [=3D transformed elements=] may interpenetrate with content and untransformed elements. -Note: Because the 3D-transformed elements in a 3D rendering context can all depth-sort and intersect with each other, they are effectively rendered as if they were siblings. The effect of transform-style: preserve-3d can then be thought of as causing all the 3D transformed elements in a 3D rendering context to be hoisted up into the establishing element, but still rendered with their accumulated 3D transformation matrix. +Note: Because the 3D-transformed elements in a 3D rendering context can all depth-sort and intersect with each other, they are effectively rendered as if they were siblings. The effect of transform-style: preserve-3d can then be thought of as causing all the [=3D transformed elements=] in a 3D rendering context to be hoisted up into the establishing element, but still rendered with their accumulated 3D transformation matrix.
    @@ -325,7 +331,7 @@ This example shows show elements in a 3D rendering context can intersect. The co
     
     The ''perspective'' property can be used to ensure that 3D transformed elements in the resulting 3D rendering context appear to live in a common three-dimensional space with depth, by suppling a common perspective matrix to descendant transformed members of its 3D rendering context, which is taken into account in the accumulated 3D matrix computation.
     
    -By default, elements with value for ''perspective'' other than ''perspective/none'' are flattening, and thus establish a 3D rendering context. However, setting ''transform-style'' to ''preserve-3d'' allows the perspective element to extend its containing 3D rendering context (provided no other grouping property values are in effect).
    +By default, elements with value for ''perspective'' other than ''perspective/none'' are [=flattening element|flattening=], and thus establish a 3D rendering context. However, setting ''transform-style'' to ''preserve-3d'' allows the perspective element to extend its containing 3D rendering context (provided no other grouping property values are in effect).
     
     
    @@ -356,7 +362,7 @@ By default, elements with value for ''perspective'' other than ''perspective/non
     	</div>
     	
    -This example shows how nested 3D transforms are rendered. The blue div is transformed as in the previous example, with its rendering influenced by the perspective on its parent element. The lime element also has a 3D transform, which is a rotation about the X axis (anchored at the top, by virtue of the transform-origin). However, the lime element is being rendered into the plane of its parent because it is not a member of the same 3D rendering context; the parent is "flattening". Thus the lime element only appears shorter; it does not "pop out" of the blue element. +This example shows how nested 3D transforms are rendered. The blue div is transformed as in the previous example, with its rendering influenced by the perspective on its parent element. The lime element also has a 3D transform, which is a rotation about the X axis (anchored at the top, by virtue of the transform-origin). However, the lime element is being rendered into the plane of its parent because it is not a member of the same 3D rendering context; the parent is [=flattening element|flattening=]. Thus the lime element only appears shorter; it does not "pop out" of the blue element.
    Nested 3D transforms, with flattening @@ -365,7 +371,7 @@ This example shows how nested 3D transforms are rendered. The blue div is transf ### Transformed element hierarchies ### {#transformed-element-hierarchies} -By default, transformed elements are flattening, and thus establish a 3D rendering context. However, since it is useful to construct hierarchies of transformed objects that share a common 3-dimensional space, this flattening behavior may be overridden by specifying a value of ''preserve-3d'' for the ''transform-style'' property, provided no other grouping property values are in effect. This allows descendants of the transformed element to share the same 3D rendering context. Non-3D-transformed descendants of such elements are rendered into the plane of the element in step C above, but 3D-transformed elements in the same 3D rendering context will "pop out" into their own planes. +By default, transformed elements are [=flattening element|flattening=], and thus establish a 3D rendering context. However, since it is useful to construct hierarchies of transformed objects that share a common 3-dimensional space, this flattening behavior may be overridden by specifying a value of ''preserve-3d'' for the ''transform-style'' property, provided no other grouping property values are in effect. This allows descendants of the transformed element to share the same 3D rendering context. Non-3D-transformed descendants of such elements are rendered into the plane of the element in step C above, but 3D-transformed elements in the same 3D rendering context will "pop out" into their own planes.
    @@ -419,7 +425,7 @@ Note: as described here, the accumulated 3D transformation matrix takes i
     
     Using three-dimensional transforms, it's possible to transform an element such that its reverse side is visible. 3D-transformed elements show the same content on both sides, so the reverse side looks like a mirror-image of the front side (as if the element were projected onto a sheet of glass). Normally, elements whose reverse side is towards the viewer remain visible. However, the 'backface-visibility' property allows the author to make an element invisible when its reverse side is towards the viewer. This behavior is "live"; if an element with ''backface-visibility: hidden'' were animating, such that its front and reverse sides were alternately visible, then it would only be visible when the front side were towards the viewer.
     
    -Visibility of the reverse side of an element is considered using the accumulated 3D transformation matrix, and is thus relative to the enclosing flattening element.
    +Visibility of the reverse side of an element is considered using the accumulated 3D transformation matrix, and is thus relative to the enclosing [=flattening element=].
     
     Note: This property is useful when you place two elements back-to-back, as you would to create a playing card. Without this property, the front and back elements could switch places at times during an animation to flip the card. Another example is creating a box out of 6 elements, but where you want to see only the inside faces of the box.
     
    @@ -1106,6 +1112,74 @@ The transform functions <>, ''matrix3d()'' and ''perspective()'' get c
     
     For interpolations with the primitive ''rotate3d()'', the direction vectors of the transform functions get normalized first. If the normalized vectors are equal, the rotation angle gets interpolated numerically. Otherwise the transform functions get converted into 4x4 matrices first and interpolated as defined in section Interpolation of Matrices afterwards.
     
    +Addition and accumulation of transform lists {#combining-transform-lists}
    +============================================
    +
    +
    + Addition of two transform lists + Va and Vb + is defined as [=list=] concatenation + such that Vresult is equal to + Vb [=list/appended=] to + Va. +
    + +
    + Accumulation of two transform lists + Va and Vb + follows the same steps as interpolation + with regards to matching transform functions including + padding lists with identity transform functions, + converting ''transform/none'' to an identity transform function, + and converting both arguments to matrices as necessary (see + [[css-transforms-1#interpolation-of-transforms]]). + However, instead of interpolating the individual parameters, + they are combined using arithmetic addition-- + except in the case of parameters whose value is one in the + identity transform function + (e.g. scale parameters and matrix elements + m11, m22, + m33, and m44), + which combine using accumulation for one-based values + as follows: + + Vresult = + Va + Vb - 1 + +
    + The above definition preserves the intent of accumulation which is that + Vb acts as + a delta from Va + and allows an animation such as: + +
    +    div.animate(
    +      { transform: ['scale(1)', 'scale(2)'] },
    +      {
    +        duration: 1000,
    +        easing: 'ease',
    +      }
    +    );
    +    
    + + to produce the expected behavior when extended as follows: + +
    +    div.animate(
    +      { transform: ['scale(1)', 'scale(2)'] },
    +      {
    +        duration: 1000,
    +        easing: 'ease',
    +        iterations: 5,
    +        iterationComposite: 'accumulate',
    +      }
    +    );
    +    
    +
    +
    + + Mathematical Description of Transform Functions {#mathematical-description} =============================================== diff --git a/web-animations-1/Overview.bs b/web-animations-1/Overview.bs index 43d0d05ae1b..15d52fcf685 100644 --- a/web-animations-1/Overview.bs +++ b/web-animations-1/Overview.bs @@ -3068,57 +3068,6 @@ to the property's specified {{PropertyDescriptor/syntax}} or when the custom property is not registered, the animation type is discrete. -

    Transform list

    - -A property whose animation type is transform list has the following -behavior: - -* interpolation: - as defined in Interpolation - of Transforms [[CSS3-TRANSFORMS]]. - -* addition: performed by - concatenating transform lists as - ‘Va Vb’. - -* accumulation: - - 1. Beginning at the end of each list, Va - and Vb, - find the largest contiguous portion of each list where the - corresponding list elements from each list have the same - transform type. - Call the matching portions from Va and - Vb, Vmatching-a - and - Vmatching-b respectively and likewise - Vremainder-a and - Vremainder-b for the non-matching - parts. -

    - We should probably expand 2d functions to their 3d - equivalents before matching? -

    - 2. Let Vcombined be a transform list - combining Vmatching-a and - Vmatching-b by adding the numeric - components of each corresponding function. -

    - This needs to be more specific, e.g. when combining - translate(20px) and translate(30px - 10px) we have to expand the first function to - translate(20px 0px) first. - Probably need to define unit conversion too. -

    - 3. The result of accumulation is a transform list created by adding the combined result - with the non-matching portions of the two lists as follows: - ‘Vremainder-a - Vremainder-b - Vcombined’. -

    Keyframe effects