Changeset 289599 in webkit


Ignore:
Timestamp:
Feb 10, 2022 6:27:02 PM (5 months ago)
Author:
Nikos Mouchtaris
Message:

Web animations- Composite operation accumulation support for transform properties
https://bugs.webkit.org/show_bug.cgi?id=236116

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-transforms/animation/transform-matrix-composition-expected.txt:
  • web-platform-tests/css/css-transforms/animation/transform-rotate-composition-expected.txt:
  • web-platform-tests/css/css-transforms/animation/transform-skew-composition-expected.txt:
  • web-platform-tests/css/css-transforms/animation/transform-translate-composition-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
  • web-platform-tests/web-animations/animation-model/combining-effects/effect-composition-expected.txt:

Source/WebCore:

This patch brings further support for accumulation on transform properties. The main aspect being addressed
is handling accumulation of TransformationMatrices. This involves accumulating on the decomposed functions,
which occurs in blendFloat() and accumulateQuaternion(). Since we need to perform accumulation for one-based
values on certain decomposed functions, (scale, diagonals of matrices, etc), we set the operation to accumulate
only for these cases.

A couple of bugs introduced by this additional support are also addressed. For a property with a
different transform operation than the keyframes given, transformFunctionListsMatch() would return
true when it shouldn't. Addressed by checking in blendByMatchingOperations and falling back on matrix
interpolation. Another bug is that we need to pass the composite operation to TransformationMatrix blend().
Another bug is that we should to use Replace behavior if either of the transform matrices are
non-invertible.

  • animation/CSSPropertyAnimation.cpp:

(WebCore::blendFunc):

  • platform/graphics/transforms/Matrix3DTransformOperation.cpp:

(WebCore::createOperation):

  • platform/graphics/transforms/MatrixTransformOperation.cpp:

(WebCore::MatrixTransformOperation::blend):

  • platform/graphics/transforms/RotateTransformOperation.cpp:

(WebCore::RotateTransformOperation::blend):

  • platform/graphics/transforms/TransformOperations.cpp:

(WebCore::TransformOperations::blendByMatchingOperations const):
(WebCore::TransformOperations::blendByUsingMatrixInterpolation const):
(WebCore::TransformOperations::blend const):

  • platform/graphics/transforms/TransformOperations.h:

(WebCore::TransformOperations::isInvertible const):

  • platform/graphics/transforms/TransformationMatrix.cpp:

(WebCore::blendFloat):
(WebCore::TransformationMatrix::blend2):
(WebCore::accumulateQuaternion):
(WebCore::TransformationMatrix::blend4):
(WebCore::TransformationMatrix::blend):

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r289558 r289599  
     12022-02-10  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
     2
     3        Web animations- Composite operation accumulation support for transform properties
     4        https://bugs.webkit.org/show_bug.cgi?id=236116
     5
     6        Reviewed by Simon Fraser.
     7
     8        * web-platform-tests/css/css-transforms/animation/transform-matrix-composition-expected.txt:
     9        * web-platform-tests/css/css-transforms/animation/transform-rotate-composition-expected.txt:
     10        * web-platform-tests/css/css-transforms/animation/transform-skew-composition-expected.txt:
     11        * web-platform-tests/css/css-transforms/animation/transform-translate-composition-expected.txt:
     12        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
     13        * web-platform-tests/web-animations/animation-model/combining-effects/effect-composition-expected.txt:
     14
    1152022-02-10  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-matrix-composition-expected.txt

    r287909 r289599  
    2828PASS Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from add [matrix(1, 1, 0, 0, 0, 100)] to add [matrix(1, 0, 0, 1, 200, 0)] at (1) should be [matrix(1, 0, 0, 1, 300, 0)]
    2929FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from add [matrix(1, 1, 0, 0, 0, 100)] to add [matrix(1, 0, 0, 1, 200, 0)] at (1.5) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.99 , - 0.56 , 0.37 , 1.59 , 487.5 , - 137.5 ) "
    30 FAIL Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (-0.5) should be [matrix(0, 1, -1, 0, 150, 0)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 150 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 50 , 0 ) "
    31 FAIL Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0) should be [matrix(0, 1, -1, 0, 200, 0)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 200 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 100 , 0 ) "
    32 FAIL Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.25) should be [matrix(0, 1, -1, 0, 225, 0)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 225 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 125 , 0 ) "
    33 FAIL Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.5) should be [matrix(0, 1, -1, 0, 250, 0)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 250 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 150 , 0 ) "
    34 FAIL Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.75) should be [matrix(0, 1, -1, 0, 275, 0)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 275 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 175 , 0 ) "
    35 FAIL Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1) should be [matrix(0, 1, -1, 0, 300, 0)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 300 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 200 , 0 ) "
    36 FAIL Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1.5) should be [matrix(0, 1, -1, 0, 350, 0)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 350 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 250 , 0 ) "
    37 FAIL Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (-0.5) should be [translateX(150px) rotate3d(1, 1, 0, 45deg)] assert_equals: expected "matrix3d ( 0.85 , 0.15 , - 0.5 , 0 , 0.15 , 0.85 , 0.5 , 0 , 0.5 , - 0.5 , 0.71 , 0 , 150 , 0 , 0 , 1 ) " but got "matrix ( 1 , 0 , 0 , 1 , 50 , 0 ) "
    38 FAIL Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (0) should be [translateX(200px) rotate3d(1, 1, 0, 45deg)] assert_equals: expected "matrix3d ( 0.85 , 0.15 , - 0.5 , 0 , 0.15 , 0.85 , 0.5 , 0 , 0.5 , - 0.5 , 0.71 , 0 , 200 , 0 , 0 , 1 ) " but got "matrix ( 1 , 0 , 0 , 1 , 100 , 0 ) "
    39 FAIL Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (0.25) should be [translateX(225px) rotate3d(1, 1, 0, 45deg)] assert_equals: expected "matrix3d ( 0.85 , 0.15 , - 0.5 , 0 , 0.15 , 0.85 , 0.5 , 0 , 0.5 , - 0.5 , 0.71 , 0 , 225 , 0 , 0 , 1 ) " but got "matrix ( 1 , 0 , 0 , 1 , 125 , 0 ) "
    40 FAIL Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (0.5) should be [translateX(250px) rotate3d(1, 1, 0, 45deg)] assert_equals: expected "matrix3d ( 0.85 , 0.15 , - 0.5 , 0 , 0.15 , 0.85 , 0.5 , 0 , 0.5 , - 0.5 , 0.71 , 0 , 250 , 0 , 0 , 1 ) " but got "matrix ( 1 , 0 , 0 , 1 , 150 , 0 ) "
    41 FAIL Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (0.75) should be [translateX(275px) rotate3d(1, 1, 0, 45deg)] assert_equals: expected "matrix3d ( 0.85 , 0.15 , - 0.5 , 0 , 0.15 , 0.85 , 0.5 , 0 , 0.5 , - 0.5 , 0.71 , 0 , 275 , 0 , 0 , 1 ) " but got "matrix ( 1 , 0 , 0 , 1 , 175 , 0 ) "
    42 FAIL Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (1) should be [translateX(300px) rotate3d(1, 1, 0, 45deg)] assert_equals: expected "matrix3d ( 0.85 , 0.15 , - 0.5 , 0 , 0.15 , 0.85 , 0.5 , 0 , 0.5 , - 0.5 , 0.71 , 0 , 300 , 0 , 0 , 1 ) " but got "matrix ( 1 , 0 , 0 , 1 , 200 , 0 ) "
    43 FAIL Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (1.5) should be [translateX(350px) rotate3d(1, 1, 0, 45deg)] assert_equals: expected "matrix3d ( 0.85 , 0.15 , - 0.5 , 0 , 0.15 , 0.85 , 0.5 , 0 , 0.5 , - 0.5 , 0.71 , 0 , 350 , 0 , 0 , 1 ) " but got "matrix ( 1 , 0 , 0 , 1 , 250 , 0 ) "
     30PASS Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (-0.5) should be [matrix(0, 1, -1, 0, 150, 0)]
     31PASS Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0) should be [matrix(0, 1, -1, 0, 200, 0)]
     32PASS Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.25) should be [matrix(0, 1, -1, 0, 225, 0)]
     33PASS Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.5) should be [matrix(0, 1, -1, 0, 250, 0)]
     34PASS Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.75) should be [matrix(0, 1, -1, 0, 275, 0)]
     35PASS Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1) should be [matrix(0, 1, -1, 0, 300, 0)]
     36PASS Compositing: property <transform> underlying [matrix(0, 1, -1, 0, 100, 0)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1.5) should be [matrix(0, 1, -1, 0, 350, 0)]
     37PASS Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (-0.5) should be [translateX(150px) rotate3d(1, 1, 0, 45deg)]
     38PASS Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (0) should be [translateX(200px) rotate3d(1, 1, 0, 45deg)]
     39PASS Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (0.25) should be [translateX(225px) rotate3d(1, 1, 0, 45deg)]
     40PASS Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (0.5) should be [translateX(250px) rotate3d(1, 1, 0, 45deg)]
     41PASS Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (0.75) should be [translateX(275px) rotate3d(1, 1, 0, 45deg)]
     42PASS Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (1) should be [translateX(300px) rotate3d(1, 1, 0, 45deg)]
     43PASS Compositing: property <transform> underlying [matrix3d(0.8535533905932737,0.1464466094067262,-0.5,0,0.1464466094067262,0.8535533905932737,0.5,0,0.5,-0.5,0.7071067811865476,0,100,0,0,1)] from accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 0, 0, 1)] to accumulate [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 0, 0, 1)] at (1.5) should be [translateX(350px) rotate3d(1, 1, 0, 45deg)]
    4444PASS Compositing: property <transform> underlying [matrix(1, 1, 0, 0, 0, 100)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (-0.5) should be [matrix(1, 0, 0, 1, 50, 0)]
    4545PASS Compositing: property <transform> underlying [matrix(1, 1, 0, 0, 0, 100)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0) should be [matrix(1, 0, 0, 1, 100, 0)]
     
    4949PASS Compositing: property <transform> underlying [matrix(1, 1, 0, 0, 0, 100)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1) should be [matrix(1, 0, 0, 1, 200, 0)]
    5050PASS Compositing: property <transform> underlying [matrix(1, 1, 0, 0, 0, 100)] from accumulate [matrix(1, 0, 0, 1, 100, 0)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1.5) should be [matrix(1, 0, 0, 1, 250, 0)]
    51 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (-0.5) should be [matrix(1, 1, 0, 0, 0, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 0 , 100 ) " but got "matrix ( 1.28 , 0.84 , - 0.03 , 0.3 , 87.5 , - 37.5 ) "
     51FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (-0.5) should be [matrix(1, 1, 0, 0, 0, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 0 , 100 ) " but got "matrix ( 1.28 , 0.84 , - 0.03 , 0.3 , 75 , - 75 ) "
    5252PASS Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0) should be [matrix(1, 1, 0, 0, 0, 100)]
    53 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.25) should be [matrix(1, 1, 0, 0, 0, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 0 , 100 ) " but got "matrix ( 0.95 , 0.86 , - 0.01 , 0.08 , 59.38 , 65.63 ) "
    54 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.5) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.95 , 0.63 , - 0.03 , 0.3 , 87.5 , 62.5 ) "
    55 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.75) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.97 , 0.32 , - 0.04 , 0.63 , 134.38 , 40.63 ) "
    56 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 200 , 0 ) "
    57 FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1.5) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.99 , - 0.56 , 0.37 , 1.59 , 387.5 , - 137.5 ) "
     53FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.25) should be [matrix(1, 1, 0, 0, 0, 100)] assert_equals: expected "matrix ( 1 , 1 , 0 , 0 , 0 , 100 ) " but got "matrix ( 0.95 , 0.86 , - 0.01 , 0.08 , 75 , 75 ) "
     54FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.5) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.95 , 0.63 , - 0.03 , 0.3 , 125 , 75 ) "
     55FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (0.75) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.97 , 0.32 , - 0.04 , 0.63 , 200 , 50 ) "
     56PASS Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1) should be [matrix(1, 0, 0, 1, 300, 0)]
     57FAIL Compositing: property <transform> underlying [matrix(1, 0, 0, 1, 100, 0)] from accumulate [matrix(1, 1, 0, 0, 0, 100)] to accumulate [matrix(1, 0, 0, 1, 200, 0)] at (1.5) should be [matrix(1, 0, 0, 1, 300, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) " but got "matrix ( 0.99 , - 0.56 , 0.37 , 1.59 , 575 , - 175 ) "
    5858
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-rotate-composition-expected.txt

    r285631 r289599  
    4949PASS Compositing: property <transform> underlying [rotateZ(20deg)] from accumulate [rotateZ(40deg)] to accumulate [rotateZ(60deg)] at (1) should be [rotateZ(80deg)]
    5050PASS Compositing: property <transform> underlying [rotateZ(20deg)] from accumulate [rotateZ(40deg)] to accumulate [rotateZ(60deg)] at (1.5) should be [rotateZ(90deg)]
    51 FAIL Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (-0.5) should be [rotateX(45deg) rotateY(10deg)] assert_equals: expected "matrix3d ( 0.98 , 0.12 , - 0.12 , 0 , 0 , 0.71 , 0.71 , 0 , 0.17 , - 0.7 , 0.7 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.98 , 0 , - 0.17 , 0 , 0 , 1 , 0 , 0 , 0.17 , 0 , 0.98 , 0 , 0 , 0 , 0 , 1 ) "
    52 FAIL Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (0) should be [rotateX(45deg) rotateY(30deg)] assert_equals: expected "matrix3d ( 0.87 , 0.35 , - 0.35 , 0 , 0 , 0.71 , 0.71 , 0 , 0.5 , - 0.61 , 0.61 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.87 , 0 , - 0.5 , 0 , 0 , 1 , 0 , 0 , 0.5 , 0 , 0.87 , 0 , 0 , 0 , 0 , 1 ) "
    53 FAIL Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (0.25) should be [rotateX(45deg) rotateY(40deg)] assert_equals: expected "matrix3d ( 0.77 , 0.45 , - 0.45 , 0 , 0 , 0.71 , 0.71 , 0 , 0.64 , - 0.54 , 0.54 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.77 , 0 , - 0.64 , 0 , 0 , 1 , 0 , 0 , 0.64 , 0 , 0.77 , 0 , 0 , 0 , 0 , 1 ) "
    54 FAIL Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (0.5) should be [rotateX(45deg) rotateY(50deg)] assert_equals: expected "matrix3d ( 0.64 , 0.54 , - 0.54 , 0 , 0 , 0.71 , 0.71 , 0 , 0.77 , - 0.45 , 0.45 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.64 , 0 , - 0.77 , 0 , 0 , 1 , 0 , 0 , 0.77 , 0 , 0.64 , 0 , 0 , 0 , 0 , 1 ) "
    55 FAIL Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (0.75) should be [rotateX(45deg) rotateY(60deg)] assert_equals: expected "matrix3d ( 0.5 , 0.61 , - 0.61 , 0 , 0 , 0.71 , 0.71 , 0 , 0.87 , - 0.35 , 0.35 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.5 , 0 , - 0.87 , 0 , 0 , 1 , 0 , 0 , 0.87 , 0 , 0.5 , 0 , 0 , 0 , 0 , 1 ) "
    56 FAIL Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (1) should be [rotateX(45deg) rotateY(70deg)] assert_equals: expected "matrix3d ( 0.34 , 0.66 , - 0.66 , 0 , 0 , 0.71 , 0.71 , 0 , 0.94 , - 0.24 , 0.24 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.34 , 0 , - 0.94 , 0 , 0 , 1 , 0 , 0 , 0.94 , 0 , 0.34 , 0 , 0 , 0 , 0 , 1 ) "
    57 FAIL Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (1.5) should be [rotateX(45deg) rotateY(90deg)] assert_equals: expected "matrix3d ( 0 , 0.71 , - 0.71 , 0 , 0 , 0.71 , 0.71 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0 , 0 , - 1 , 0 , 0 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ) "
     51PASS Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (-0.5) should be [rotateX(45deg) rotateY(10deg)]
     52PASS Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (0) should be [rotateX(45deg) rotateY(30deg)]
     53PASS Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (0.25) should be [rotateX(45deg) rotateY(40deg)]
     54PASS Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (0.5) should be [rotateX(45deg) rotateY(50deg)]
     55PASS Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (0.75) should be [rotateX(45deg) rotateY(60deg)]
     56PASS Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (1) should be [rotateX(45deg) rotateY(70deg)]
     57PASS Compositing: property <transform> underlying [rotateX(45deg)] from accumulate [rotateY(30deg)] to accumulate [rotateY(70deg)] at (1.5) should be [rotateX(45deg) rotateY(90deg)]
    5858PASS Compositing: property <transform> underlying [rotate(45deg) skew(10deg, 20deg)] from accumulate [rotate(45deg)] to accumulate [rotate(225deg)] at (-0.5) should be [rotate(0deg) skew(10deg, 20deg)]
    5959PASS Compositing: property <transform> underlying [rotate(45deg) skew(10deg, 20deg)] from accumulate [rotate(45deg)] to accumulate [rotate(225deg)] at (0) should be [rotate(90deg) skew(10deg, 20deg)]
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-skew-composition-expected.txt

    r285631 r289599  
    4242PASS Compositing: property <transform> underlying [skew(10deg, 45deg)] from accumulate [skew(20deg, 30deg)] to accumulate [skew(40deg, 70deg)] at (1) should be [skew(50deg, 115deg)]
    4343PASS Compositing: property <transform> underlying [skew(10deg, 45deg)] from accumulate [skew(20deg, 30deg)] to accumulate [skew(40deg, 70deg)] at (1.5) should be [skew(60deg, 135deg)]
    44 FAIL Compositing: property <transform> underlying [skewX(45deg)] from accumulate [skewY(45deg)] to accumulate [skewY(45deg)] at (0.5) should be [matrix(1, 1, 0.5, 1.5, 0, 0)] assert_equals: expected "matrix ( 1 , 1 , 0.5 , 1.5 , 0 , 0 ) " but got "matrix ( 1 , 1 , 0 , 1 , 0 , 0 ) "
     44FAIL Compositing: property <transform> underlying [skewX(45deg)] from accumulate [skewY(45deg)] to accumulate [skewY(45deg)] at (0.5) should be [matrix(1, 1, 0.5, 1.5, 0, 0)] assert_equals: expected "matrix ( 1 , 1 , 0.5 , 1.5 , 0 , 0 ) " but got "matrix ( 1.71 , 0.71 , 0.71 , 1.12 , 0 , 0 ) "
    4545
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-translate-composition-expected.txt

    r289032 r289599  
    4949PASS Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (1) should be [translate3d(100px, 50px, 250px)]
    5050PASS Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (1.5) should be [translate3d(100px, 50px, 350px)]
    51 FAIL Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (-0.5) should be [translateX(150px) rotate(90deg)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 150 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 150 , 0 ) "
    52 FAIL Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (0) should be [translateX(200px) rotate(90deg)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 200 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 200 , 0 ) "
    53 FAIL Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (0.25) should be [translateX(225px) rotate(90deg)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 225 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 225 , 0 ) "
    54 FAIL Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (0.5) should be [translateX(250px) rotate(90deg)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 250 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 250 , 0 ) "
    55 FAIL Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (0.75) should be [translateX(275px) rotate(90deg)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 275 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 275 , 0 ) "
    56 FAIL Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (1) should be [translateX(300px) rotate(90deg)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 300 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 300 , 0 ) "
    57 FAIL Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (1.5) should be [translateX(350px) rotate(90deg)] assert_equals: expected "matrix ( 0 , 1 , - 1 , 0 , 350 , 0 ) " but got "matrix ( 1 , 0 , 0 , 1 , 350 , 0 ) "
     51PASS Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (-0.5) should be [translateX(150px) rotate(90deg)]
     52PASS Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (0) should be [translateX(200px) rotate(90deg)]
     53PASS Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (0.25) should be [translateX(225px) rotate(90deg)]
     54PASS Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (0.5) should be [translateX(250px) rotate(90deg)]
     55PASS Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (0.75) should be [translateX(275px) rotate(90deg)]
     56PASS Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (1) should be [translateX(300px) rotate(90deg)]
     57PASS Compositing: property <transform> underlying [translateX(100px) rotate(90deg)] from accumulate [translateX(100px)] to accumulate [translateX(200px)] at (1.5) should be [translateX(350px) rotate(90deg)]
    5858
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt

    r287924 r289599  
    179179PASS transform: scale
    180180PASS transform: skew
    181 FAIL transform: rotate on translate assert_approx_equals: expected matrix(0, 1, -1, 0, 100, 0) but got matrix(0, 1, -1, 0, 0, 0): The value should be matrix(0, 1, -1, 0, 100, 0) at 0ms but got matrix(0, 1, -1, 0, 0, 0) expected 100 +/- 0.0001 but got 0
    182 FAIL transform: translate on rotate assert_approx_equals: expected matrix(0, 1, -1, 0, 100, 0) but got matrix(1, 0, 0, 1, 100, 0): The value should be matrix(0, 1, -1, 0, 100, 0) at 0ms but got matrix(1, 0, 0, 1, 100, 0) expected 0 +/- 0.0001 but got 1
     181PASS transform: rotate on translate
     182PASS transform: translate on rotate
    183183PASS transform: rotate and translate on rotate
    184184PASS transform: rotate on rotate and translate
    185 FAIL transform: matrix assert_approx_equals: expected matrix(0, 1, -1, 0, 100, 0) but got matrix(1, 0, 0, 1, 100, 0): The value should be matrix(0, 1, -1, 0, 100, 0) at 0ms but got matrix(1, 0, 0, 1, 100, 0) expected 0 +/- 0.0001 but got 1
     185PASS transform: matrix
    186186PASS transform: rotate3d
    187 FAIL transform: matrix3d assert_approx_equals: expected matrix3d(0.853553, 0.146447, 0.5, 0, 0.146447, 0.853553, -0.5, 0, -0.5, 0.5, 0.707107, 0, 0, 0, 0, 1) but got matrix3d(0.5, 0.5, 0.707107, 0, 0.5, 0.5, -0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 0, 0, 1): The value should be matrix3d(0.853553, 0.146447, 0.5, 0, 0.146447, 0.853553, -0.5, 0, -0.5, 0.5, 0.707107, 0, 0, 0, 0, 1) at 0ms but got matrix3d(0.5, 0.5, 0.707107, 0, 0.5, 0.5, -0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 0, 0, 1) expected 0.853553 +/- 0.0001 but got 0.5
    188 FAIL transform: none assert_equals: dimension of the matrix: The value should be matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1) at 0ms but got matrix(1, 0, 0, 1, 0, 0) expected 16 but got 6
     187PASS transform: matrix3d
     188PASS transform: none
    189189PASS transform: non-invertible matrices (non-invertible onto invertible)
    190190PASS transform: non-invertible matrices (invertible onto non-invertible)
    191 FAIL transform: non-invertible matrices in matched transform lists (non-invertible onto invertible) assert_approx_equals: expected matrix(-1, -1, 0, 0, 100, 100) but got matrix(0, 0, 1, 1, 150, 100): The value should be matrix(-1, -1, 0, 0, 100, 100) at 0ms but got matrix(0, 0, 1, 1, 150, 100) expected -1 +/- 0.0001 but got 0
    192 FAIL transform: non-invertible matrices in matched transform lists (invertible onto non-invertible) assert_approx_equals: expected matrix(0, -1, 1, 0, 250, 0) but got matrix(0, 1, -1, 0, 350, 0): The value should be matrix(0, -1, 1, 0, 250, 0) at 0ms but got matrix(0, 1, -1, 0, 350, 0) expected -1 +/- 0.0001 but got 1
    193 FAIL transform: non-invertible matrices in mismatched transform lists (non-invertible onto invertible) assert_approx_equals: expected matrix(1, 1, 1, 1, 100, 100) but got matrix(1, 1, 1, 1, 150, 100): The value should be matrix(1, 1, 1, 1, 100, 100) at 0ms but got matrix(1, 1, 1, 1, 150, 100) expected 100 +/- 0.0001 but got 150
    194 FAIL transform: non-invertible matrices in mismatched transform lists (invertible onto non-invertible) assert_approx_equals: expected matrix(-2, 0, 0, -2, 250, 0) but got matrix(-2, 0, 0, -2, 350, 0): The value should be matrix(-2, 0, 0, -2, 250, 0) at 0ms but got matrix(-2, 0, 0, -2, 350, 0) expected 250 +/- 0.0001 but got 350
     191PASS transform: non-invertible matrices in matched transform lists (non-invertible onto invertible)
     192PASS transform: non-invertible matrices in matched transform lists (invertible onto non-invertible)
     193PASS transform: non-invertible matrices in mismatched transform lists (non-invertible onto invertible)
     194PASS transform: non-invertible matrices in mismatched transform lists (invertible onto non-invertible)
    195195PASS transform-box (type: discrete) has testAccumulation function
    196196PASS transform-box: "border-box" onto "fill-box"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/combining-effects/effect-composition-expected.txt

    r289454 r289599  
    22PASS accumulate onto the base value
    33PASS accumulate onto an underlying animation value
    4 FAIL accumulate onto an underlying animation value with implicit from values assert_equals: Animated style at 50% expected "matrix(1, 0, 0, 1, 50, 50)" but got "matrix(1, 0, 0, 1, 25, 50)"
    5 FAIL accumulate onto an underlying animation value with implicit to values assert_equals: Animated style at 50% expected "matrix(1, 0, 0, 1, 50, 50)" but got "matrix(1, 0, 0, 1, 25, 50)"
     4PASS accumulate onto an underlying animation value with implicit from values
     5PASS accumulate onto an underlying animation value with implicit to values
    66PASS Composite when mixing accumulate and replace
    77PASS accumulate specified on a keyframe overrides the composite mode of the effect
  • trunk/Source/WebCore/ChangeLog

    r289598 r289599  
     12022-02-10  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
     2
     3        Web animations- Composite operation accumulation support for transform properties
     4        https://bugs.webkit.org/show_bug.cgi?id=236116
     5
     6        Reviewed by Simon Fraser.
     7
     8        This patch brings further support for accumulation on transform properties. The main aspect being addressed
     9        is handling accumulation of TransformationMatrices. This involves accumulating on the decomposed functions,
     10        which occurs in blendFloat() and accumulateQuaternion(). Since we need to perform accumulation for one-based
     11        values on certain decomposed functions, (scale, diagonals of matrices, etc), we set the operation to accumulate
     12        only for these cases.
     13       
     14        A couple of bugs introduced by this additional support are also addressed. For a property with a
     15        different transform operation than the keyframes given, transformFunctionListsMatch() would return
     16        true when it shouldn't. Addressed by checking in blendByMatchingOperations and falling back on matrix
     17        interpolation. Another bug is that we need to pass the composite operation to TransformationMatrix blend().
     18        Another bug is that we should to use Replace behavior if either of the transform matrices are
     19        non-invertible.
     20
     21        * animation/CSSPropertyAnimation.cpp:
     22        (WebCore::blendFunc):
     23        * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
     24        (WebCore::createOperation):
     25        * platform/graphics/transforms/MatrixTransformOperation.cpp:
     26        (WebCore::MatrixTransformOperation::blend):
     27        * platform/graphics/transforms/RotateTransformOperation.cpp:
     28        (WebCore::RotateTransformOperation::blend):
     29        * platform/graphics/transforms/TransformOperations.cpp:
     30        (WebCore::TransformOperations::blendByMatchingOperations const):
     31        (WebCore::TransformOperations::blendByUsingMatrixInterpolation const):
     32        (WebCore::TransformOperations::blend const):
     33        * platform/graphics/transforms/TransformOperations.h:
     34        (WebCore::TransformOperations::isInvertible const):
     35        * platform/graphics/transforms/TransformationMatrix.cpp:
     36        (WebCore::blendFloat):
     37        (WebCore::TransformationMatrix::blend2):
     38        (WebCore::accumulateQuaternion):
     39        (WebCore::TransformationMatrix::blend4):
     40        (WebCore::TransformationMatrix::blend):
     41
    1422022-02-10  Antoine Quint  <graouts@webkit.org>
    243
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r288964 r289599  
    171171        return resultOperations;
    172172    }
    173 
     173    auto boxSize = is<RenderBox>(context.client->renderer()) ? downcast<RenderBox>(*context.client->renderer()).borderBoxRect().size() : LayoutSize();
    174174    if (context.client->transformFunctionListsMatch())
    175         return to.blendByMatchingOperations(from, context);
    176     return to.blendByUsingMatrixInterpolation(from, context, is<RenderBox>(context.client->renderer()) ? downcast<RenderBox>(*context.client->renderer()).borderBoxRect().size() : LayoutSize());
     175        return to.blendByMatchingOperations(from, context, boxSize);
     176    return to.blendByUsingMatrixInterpolation(from, context, boxSize);
    177177}
    178178
  • trunk/Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.cpp

    r289032 r289599  
    4040static Ref<TransformOperation> createOperation(TransformationMatrix& to, TransformationMatrix& from, const BlendingContext& context)
    4141{
    42     to.blend(from, context.progress);
     42    to.blend(from, context.progress, context.compositeOperation);
    4343    return Matrix3DTransformOperation::create(to);
    4444}
  • trunk/Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.cpp

    r289032 r289599  
    4040{
    4141    auto createOperation = [] (TransformationMatrix& to, TransformationMatrix& from, const BlendingContext& context) {
    42         to.blend(from, context.progress);
     42        to.blend(from, context.progress, context.compositeOperation);
    4343        return MatrixTransformOperation::create(to);
    4444    };
  • trunk/Source/WebCore/platform/graphics/transforms/RotateTransformOperation.cpp

    r289032 r289599  
    4040Ref<TransformOperation> RotateTransformOperation::blend(const TransformOperation* from, const BlendingContext& context, bool blendToIdentity)
    4141{
    42     if (blendToIdentity)
     42    if (blendToIdentity) {
     43        if (context.compositeOperation == CompositeOperation::Accumulate)
     44            return RotateTransformOperation::create(m_x, m_y, m_z, m_angle, type());
    4345        return RotateTransformOperation::create(m_x, m_y, m_z, m_angle - m_angle * context.progress, type());
    44 
     46    }
    4547    auto outputType = sharedPrimitiveType(from);
    4648    if (!outputType)
  • trunk/Source/WebCore/platform/graphics/transforms/TransformOperations.cpp

    r289032 r289599  
    7575}
    7676
    77 TransformOperations TransformOperations::blendByMatchingOperations(const TransformOperations& from, const BlendingContext& context) const
     77TransformOperations TransformOperations::blendByMatchingOperations(const TransformOperations& from, const BlendingContext& context, const LayoutSize& boxSize) const
    7878{
    7979    TransformOperations result;
    8080
    81     unsigned fromSize = from.operations().size();
    82     unsigned toSize = operations().size();
    83     unsigned size = std::max(fromSize, toSize);
    84     for (unsigned i = 0; i < size; i++) {
    85         RefPtr<TransformOperation> fromOperation = (i < fromSize) ? from.operations()[i].get() : nullptr;
    86         RefPtr<TransformOperation> toOperation = (i < toSize) ? operations()[i].get() : nullptr;
     81    unsigned fromOperationCount = from.operations().size();
     82    unsigned toOperationCount = operations().size();
     83    unsigned maxOperationCount = std::max(fromOperationCount, toOperationCount);
     84   
     85    if (context.compositeOperation == CompositeOperation::Accumulate && (!from.isInvertible(boxSize) || !isInvertible(boxSize)))
     86        return blendByUsingMatrixInterpolation(from, context, boxSize);
     87   
     88    for (unsigned i = 0; i < maxOperationCount; i++) {
     89        RefPtr<TransformOperation> fromOperation = (i < fromOperationCount) ? from.operations()[i].get() : nullptr;
     90        RefPtr<TransformOperation> toOperation = (i < toOperationCount) ? operations()[i].get() : nullptr;
     91        if (fromOperation && toOperation && !fromOperation->sharedPrimitiveType(toOperation.get()))
     92            return blendByUsingMatrixInterpolation(from, context, boxSize);
    8793        RefPtr<TransformOperation> blendedOperation = toOperation ? toOperation->blend(fromOperation.get(), context) : (fromOperation ? RefPtr<TransformOperation>(fromOperation->blend(nullptr, context, true)) : nullptr);
    8894        if (blendedOperation)
     
    100106}
    101107
    102 TransformOperations TransformOperations::blendByUsingMatrixInterpolation(const TransformOperations& from, const BlendingContext& context, const LayoutSize& size) const
     108TransformOperations TransformOperations::blendByUsingMatrixInterpolation(const TransformOperations& from, const BlendingContext& context, const LayoutSize& boxSize) const
    103109{
    104110    TransformOperations result;
     
    107113    TransformationMatrix fromTransform;
    108114    TransformationMatrix toTransform;
    109     from.apply(size, fromTransform);
    110     apply(size, toTransform);
    111 
    112     toTransform.blend(fromTransform, context.progress);
    113 
     115    from.apply(boxSize, fromTransform);
     116    apply(boxSize, toTransform);
     117    toTransform.blend(fromTransform, context.progress, context.compositeOperation);
    114118    // Append the result
    115119    result.operations().append(Matrix3DTransformOperation::create(toTransform));
     
    124128
    125129    if (from.size() && from.operationsMatch(*this))
    126         return blendByMatchingOperations(from, context);
     130        return blendByMatchingOperations(from, context, size);
    127131
    128132    return blendByUsingMatrixInterpolation(from, context, size);
  • trunk/Source/WebCore/platform/graphics/transforms/TransformOperations.h

    r276141 r289599  
    8585    size_t size() const { return m_operations.size(); }
    8686    const TransformOperation* at(size_t index) const { return index < m_operations.size() ? m_operations.at(index).get() : 0; }
    87 
    88     TransformOperations blendByMatchingOperations(const TransformOperations& from, const BlendingContext&) const;
     87    bool isInvertible(const LayoutSize& size) const
     88    {
     89        TransformationMatrix transform;
     90        apply(size, transform);
     91        return transform.isInvertible();
     92    }
     93   
     94    TransformOperations blendByMatchingOperations(const TransformOperations& from, const BlendingContext&, const LayoutSize&) const;
    8995    TransformOperations blendByUsingMatrixInterpolation(const TransformOperations& from, const BlendingContext&, const LayoutSize&) const;
    9096    TransformOperations blend(const TransformOperations& from, const BlendingContext&, const LayoutSize&) const;
  • trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp

    r285397 r289599  
    16381638static inline void blendFloat(double& from, double to, double progress, CompositeOperation compositeOperation)
    16391639{
    1640     if (compositeOperation == CompositeOperation::Replace)
     1640    switch (compositeOperation) {
     1641    case CompositeOperation::Replace:
    16411642        from = from + (to - from) * progress;
    1642     else
     1643        break;
     1644    case CompositeOperation::Accumulate:
     1645        from += from + (to - from - 1) * progress;
     1646        break;
     1647    case CompositeOperation::Add:
    16431648        from += from + (to - from) * progress;
     1649        break;
     1650    }
    16441651}
    16451652
     
    16731680            toDecomp.angle -= 360;
    16741681    }
    1675 
     1682   
     1683    // When compositeOperation is accumulate, if the decomposed function is a 1-based value (for affine matrix these properties are
     1684    // m11, m22, scaleX and scaleY), use one based accumulation. Otherwise, use behavior for add.
     1685    auto operationForNonOneBasedValues = compositeOperation == CompositeOperation::Accumulate ? CompositeOperation::Add : compositeOperation;
    16761686    blendFloat(fromDecomp.m11, toDecomp.m11, progress, compositeOperation);
    1677     blendFloat(fromDecomp.m12, toDecomp.m12, progress, compositeOperation);
    1678     blendFloat(fromDecomp.m21, toDecomp.m21, progress, compositeOperation);
     1687    blendFloat(fromDecomp.m12, toDecomp.m12, progress, operationForNonOneBasedValues);
     1688    blendFloat(fromDecomp.m21, toDecomp.m21, progress, operationForNonOneBasedValues);
    16791689    blendFloat(fromDecomp.m22, toDecomp.m22, progress, compositeOperation);
    1680     blendFloat(fromDecomp.translateX, toDecomp.translateX, progress, compositeOperation);
    1681     blendFloat(fromDecomp.translateY, toDecomp.translateY, progress, compositeOperation);
     1690    blendFloat(fromDecomp.translateX, toDecomp.translateX, progress, operationForNonOneBasedValues);
     1691    blendFloat(fromDecomp.translateY, toDecomp.translateY, progress, operationForNonOneBasedValues);
    16821692    blendFloat(fromDecomp.scaleX, toDecomp.scaleX, progress, compositeOperation);
    16831693    blendFloat(fromDecomp.scaleY, toDecomp.scaleY, progress, compositeOperation);
    1684     blendFloat(fromDecomp.angle, toDecomp.angle, progress, compositeOperation);
    1685 
     1694    blendFloat(fromDecomp.angle, toDecomp.angle, progress, operationForNonOneBasedValues);
    16861695    recompose2(fromDecomp);
    16871696}
    16881697
     1698// Compute quaternion multiplication
     1699static void accumulateQuaternion(double qa[4], const double qb[4])
     1700{
     1701    auto qx = (qb[3] * qa[0]) + (qb[0] * qa[3]) + (qb[1] * qa[2]) - (qb[2] * qa[1]);
     1702    auto qy = (qb[3] * qa[1]) + (qb[1] * qa[3]) + (qb[2] * qa[0]) - (qb[0] * qa[2]);
     1703    auto qz = (qb[3] * qa[2]) + (qb[2] * qa[3]) + (qb[0] * qa[1]) - (qb[1] * qa[0]);
     1704    auto qw = (qb[3] * qa[3]) - (qb[0] * qa[0]) - (qb[1] * qa[1]) - (qb[2] * qa[2]);
     1705    qa[0] = qx; qa[1] = qy; qa[2] = qz; qa[3] = qw;
     1706}
     1707
     1708static void interpolateQuaternion(TransformationMatrix::Decomposed4Type& fromDecomp, TransformationMatrix::Decomposed4Type& toDecomp, double progress, CompositeOperation compositeOperation)
     1709{
     1710    double qa[4] = { fromDecomp.quaternionX, fromDecomp.quaternionY, fromDecomp.quaternionZ, fromDecomp.quaternionW };
     1711    double qb[4] = { toDecomp.quaternionX, toDecomp.quaternionY, toDecomp.quaternionZ, toDecomp.quaternionW };
     1712    if (compositeOperation == CompositeOperation::Accumulate)
     1713        accumulateQuaternion(qa, qb);
     1714    else
     1715        slerp(qa, qb, progress);
     1716    fromDecomp.quaternionX = qa[0];
     1717    fromDecomp.quaternionY = qa[1];
     1718    fromDecomp.quaternionZ = qa[2];
     1719    fromDecomp.quaternionW = qa[3];
     1720   
     1721}
    16891722void TransformationMatrix::blend4(const TransformationMatrix& from, double progress, CompositeOperation compositeOperation)
    16901723{
     
    16961729        return;
    16971730    }
     1731   
     1732    // When compositeOperation is accumulate, if the decomposed function is a 1-based value (for non-affine matrix these properties are
     1733    // scaleX, scaleY, scaleZ, and perspectiveW), use one based accumulation. Otherwise, use behavior for add.
     1734    auto operationForNonOneBasedValues = compositeOperation == CompositeOperation::Accumulate ? CompositeOperation::Add : compositeOperation;
    16981735
    16991736    blendFloat(fromDecomp.scaleX, toDecomp.scaleX, progress, compositeOperation);
    17001737    blendFloat(fromDecomp.scaleY, toDecomp.scaleY, progress, compositeOperation);
    17011738    blendFloat(fromDecomp.scaleZ, toDecomp.scaleZ, progress, compositeOperation);
    1702     blendFloat(fromDecomp.skewXY, toDecomp.skewXY, progress, compositeOperation);
    1703     blendFloat(fromDecomp.skewXZ, toDecomp.skewXZ, progress, compositeOperation);
    1704     blendFloat(fromDecomp.skewYZ, toDecomp.skewYZ, progress, compositeOperation);
    1705     blendFloat(fromDecomp.translateX, toDecomp.translateX, progress, compositeOperation);
    1706     blendFloat(fromDecomp.translateY, toDecomp.translateY, progress, compositeOperation);
    1707     blendFloat(fromDecomp.translateZ, toDecomp.translateZ, progress, compositeOperation);
    1708     blendFloat(fromDecomp.perspectiveX, toDecomp.perspectiveX, progress, compositeOperation);
    1709     blendFloat(fromDecomp.perspectiveY, toDecomp.perspectiveY, progress, compositeOperation);
    1710     blendFloat(fromDecomp.perspectiveZ, toDecomp.perspectiveZ, progress, compositeOperation);
     1739    blendFloat(fromDecomp.skewXY, toDecomp.skewXY, progress, operationForNonOneBasedValues);
     1740    blendFloat(fromDecomp.skewXZ, toDecomp.skewXZ, progress, operationForNonOneBasedValues);
     1741    blendFloat(fromDecomp.skewYZ, toDecomp.skewYZ, progress, operationForNonOneBasedValues);
     1742    blendFloat(fromDecomp.translateX, toDecomp.translateX, progress, operationForNonOneBasedValues);
     1743    blendFloat(fromDecomp.translateY, toDecomp.translateY, progress, operationForNonOneBasedValues);
     1744    blendFloat(fromDecomp.translateZ, toDecomp.translateZ, progress, operationForNonOneBasedValues);
     1745    blendFloat(fromDecomp.perspectiveX, toDecomp.perspectiveX, progress, operationForNonOneBasedValues);
     1746    blendFloat(fromDecomp.perspectiveY, toDecomp.perspectiveY, progress, operationForNonOneBasedValues);
     1747    blendFloat(fromDecomp.perspectiveZ, toDecomp.perspectiveZ, progress, operationForNonOneBasedValues);
    17111748    blendFloat(fromDecomp.perspectiveW, toDecomp.perspectiveW, progress, compositeOperation);
    1712 
    1713     slerp(&fromDecomp.quaternionX, &toDecomp.quaternionX, progress);
     1749    interpolateQuaternion(fromDecomp, toDecomp, progress, compositeOperation);
    17141750
    17151751    recompose4(fromDecomp);
     
    17181754void TransformationMatrix::blend(const TransformationMatrix& from, double progress, CompositeOperation compositeOperation)
    17191755{
     1756    if (compositeOperation == CompositeOperation::Accumulate && (!from.isInvertible() || !isInvertible()))
     1757        compositeOperation = CompositeOperation::Replace;
     1758   
    17201759    if (!progress && compositeOperation == CompositeOperation::Replace) {
    17211760        *this = from;
Note: See TracChangeset for help on using the changeset viewer.