⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 289032 in webkit


Ignore:
Timestamp:
Feb 3, 2022, 12:35:59 AM (5 years ago)
Author:
Martin Robinson
Message:

Transform interpolation should blend between shared transform function primitives
https://bugs.webkit.org/show_bug.cgi?id=235311
<rdar://problem/88012700>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Mark some tests as newly passing.

  • web-platform-tests/css/css-transforms/animation/list-interpolation-expected.txt:
  • web-platform-tests/css/css-transforms/animation/matrix-interpolation-expected.txt:
  • web-platform-tests/css/css-transforms/animation/transform-interpolation-001-expected.txt:
  • web-platform-tests/css/css-transforms/animation/transform-interpolation-002-expected.txt:
  • web-platform-tests/css/css-transforms/animation/transform-interpolation-inline-value-expected.txt:
  • web-platform-tests/css/css-transforms/animation/transform-interpolation-verify-reftests-expected.txt:
  • web-platform-tests/css/css-transforms/animation/transform-translate-composition-expected.txt:

Source/WebCore:

No new tests. This is covered by existing WPT tests.

Allow direct interpolation between mismatching transform functions that share a primitive.
This fixes many tests expecting a certain computed transformation matrix in WPT, but also
allows using hardware animations more often for the CoreAnimation backend.

Rotation, scale, and translate are the only functions that have shared primitives, so they
are the only ones in this change to allow for this new behavior.

When determining if a list of keyframes has shared compatible lists of transforms, return
the vector of primitives that can represent them. In addition code for calculating big
rotations has been removed, because it was unused.

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::gSharedPrimitivesForTransformKeyframe): Added.
(WebCore::GraphicsLayer::getSharedPrimitivesForTransformKeyframes): Added.

  • platform/graphics/GraphicsLayer.h:
  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Modified to take a vector of shared
primitive types instead of a pointer to an array of operations.
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):

  • platform/graphics/ca/GraphicsLayerCA.h:
  • platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:

(WebCore::GraphicsLayerTextureMapper::addAnimation): Use new method.

  • platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:

(WebCore::CoordinatedGraphicsLayer::addAnimation): Ditto.

  • platform/graphics/transforms/Matrix3DTransformOperation.cpp:

(WebCore::Matrix3DTransformOperation::blend): Use the new sharedPrimitiveType method
to determine if the two operations can blend.

  • platform/graphics/transforms/MatrixTransformOperation.cpp:

(WebCore::MatrixTransformOperation::blend): Ditto.

  • platform/graphics/transforms/PerspectiveTransformOperation.cpp:

(WebCore::PerspectiveTransformOperation::blend): Ditto.

  • platform/graphics/transforms/RotateTransformOperation.cpp:

(WebCore::RotateTransformOperation::blend): Ditto.

  • platform/graphics/transforms/RotateTransformOperation.h:
  • platform/graphics/transforms/ScaleTransformOperation.cpp:

(WebCore::ScaleTransformOperation::blend): Ditto.

  • platform/graphics/transforms/ScaleTransformOperation.h:
  • platform/graphics/transforms/SkewTransformOperation.cpp:

(WebCore::SkewTransformOperation::blend): Ditto.

  • platform/graphics/transforms/TransformOperation.cpp:

(WebCore::TransformOperation::sharedPrimitiveType const):

  • platform/graphics/transforms/TransformOperation.h:

(WebCore::TransformOperation::primitiveType const): Added this virtual function which
return the type for the base class. Rotation, scale, and translate specialize this to
return a compatible primitive type.

  • platform/graphics/transforms/TransformOperations.cpp:

(WebCore::TransformOperations::operationsMatch const): Modified to check whether operations
share primitives.

  • platform/graphics/transforms/TranslateTransformOperation.cpp:

(WebCore::TranslateTransformOperation::blend): Use the new sharedPrimitiveType method.

  • platform/graphics/transforms/TranslateTransformOperation.h:

LayoutTests:

Remove a duplicated baseline.

  • platform/glib/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-inline-value-expected.txt: Removed.
Location:
trunk
Files:
1 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r289028 r289032  
     12022-02-03  Martin Robinson  <mrobinson@webkit.org>
     2
     3        Transform interpolation should blend between shared transform function primitives
     4        https://bugs.webkit.org/show_bug.cgi?id=235311
     5        <rdar://problem/88012700>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Remove a duplicated baseline.
     10
     11        * platform/glib/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-inline-value-expected.txt: Removed.
     12
    1132022-02-02  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r289022 r289032  
     12022-02-03  Martin Robinson  <mrobinson@webkit.org>
     2
     3        Transform interpolation should blend between shared transform function primitives
     4        https://bugs.webkit.org/show_bug.cgi?id=235311
     5        <rdar://problem/88012700>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Mark some tests as newly passing.
     10
     11        * web-platform-tests/css/css-transforms/animation/list-interpolation-expected.txt:
     12        * web-platform-tests/css/css-transforms/animation/matrix-interpolation-expected.txt:
     13        * web-platform-tests/css/css-transforms/animation/transform-interpolation-001-expected.txt:
     14        * web-platform-tests/css/css-transforms/animation/transform-interpolation-002-expected.txt:
     15        * web-platform-tests/css/css-transforms/animation/transform-interpolation-inline-value-expected.txt:
     16        * web-platform-tests/css/css-transforms/animation/transform-interpolation-verify-reftests-expected.txt:
     17        * web-platform-tests/css/css-transforms/animation/transform-translate-composition-expected.txt:
     18
    1192022-02-02  Patrick Griffis  <pgriffis@igalia.com>
    220
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/list-interpolation-expected.txt

    r287917 r289032  
    2424PASS CSS Animations: property <transform> from [scale(2) rotate(360deg) translate(100px) matrix(1, 0, 0, 1, 100, 0) skew(0deg)] to [scale(3) rotate(1080deg) translate(200px) matrix(1, 0, 0, 1, 0, 200) skew(720deg)] at (0.25) should be [scale(2.25) rotate(540deg) translate(125px) matrix(1, 0, 0, 1, 75, 50) skew(180deg)]
    2525PASS Web Animations: property <transform> from [scale(2) rotate(360deg) translate(100px) matrix(1, 0, 0, 1, 100, 0) skew(0deg)] to [scale(3) rotate(1080deg) translate(200px) matrix(1, 0, 0, 1, 0, 200) skew(720deg)] at (0.25) should be [scale(2.25) rotate(540deg) translate(125px) matrix(1, 0, 0, 1, 75, 50) skew(180deg)]
    26 FAIL CSS Transitions: property <transform> from [translateX(100px) scaleX(3) translate(500px) scale(2)] to [translateY(200px) scale(5) translateX(100px) scaleY(3)] at (0.25) should be [translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)] assert_equals: expected "matrix ( 6.13 , 0 , 0 , 4.5 , 1475 , 50 ) " but got "matrix ( 5.75 , 0 , 0 , 5.25 , 1325 , 50 ) "
    27 FAIL CSS Transitions with transition: all: property <transform> from [translateX(100px) scaleX(3) translate(500px) scale(2)] to [translateY(200px) scale(5) translateX(100px) scaleY(3)] at (0.25) should be [translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)] assert_equals: expected "matrix ( 6.13 , 0 , 0 , 4.5 , 1475 , 50 ) " but got "matrix ( 5.75 , 0 , 0 , 5.25 , 1325 , 50 ) "
    28 FAIL CSS Animations: property <transform> from [translateX(100px) scaleX(3) translate(500px) scale(2)] to [translateY(200px) scale(5) translateX(100px) scaleY(3)] at (0.25) should be [translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)] assert_equals: expected "matrix ( 6.13 , 0 , 0 , 4.5 , 1475 , 50 ) " but got "matrix ( 5.75 , 0 , 0 , 5.25 , 1325 , 50 ) "
    29 FAIL Web Animations: property <transform> from [translateX(100px) scaleX(3) translate(500px) scale(2)] to [translateY(200px) scale(5) translateX(100px) scaleY(3)] at (0.25) should be [translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)] assert_equals: expected "matrix ( 6.13 , 0 , 0 , 4.5 , 1475 , 50 ) " but got "matrix ( 5.75 , 0 , 0 , 5.25 , 1325 , 50 ) "
    30 FAIL CSS Transitions: property <transform> from [rotateX(90deg) translateX(100px)] to [rotate3d(50, 0, 0, 180deg) translateY(200px)] at (0.25) should be [rotateX(112.5deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , - 0.38 , 0.92 , 0 , 0 , - 0.92 , - 0.38 , 0 , 75 , - 19.13 , 46.19 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , - 0.38 , 0.92 , 0 , 0 , - 0.92 , - 0.38 , 0 , 75 , - 50 , 0 , 1 ) "
    31 FAIL CSS Transitions with transition: all: property <transform> from [rotateX(90deg) translateX(100px)] to [rotate3d(50, 0, 0, 180deg) translateY(200px)] at (0.25) should be [rotateX(112.5deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , - 0.38 , 0.92 , 0 , 0 , - 0.92 , - 0.38 , 0 , 75 , - 19.13 , 46.19 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , - 0.38 , 0.92 , 0 , 0 , - 0.92 , - 0.38 , 0 , 75 , - 50 , 0 , 1 ) "
    32 FAIL CSS Animations: property <transform> from [rotateX(90deg) translateX(100px)] to [rotate3d(50, 0, 0, 180deg) translateY(200px)] at (0.25) should be [rotateX(112.5deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , - 0.38 , 0.92 , 0 , 0 , - 0.92 , - 0.38 , 0 , 75 , - 19.13 , 46.19 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , - 0.38 , 0.92 , 0 , 0 , - 0.92 , - 0.38 , 0 , 75 , - 50 , 0 , 1 ) "
    33 FAIL Web Animations: property <transform> from [rotateX(90deg) translateX(100px)] to [rotate3d(50, 0, 0, 180deg) translateY(200px)] at (0.25) should be [rotateX(112.5deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , - 0.38 , 0.92 , 0 , 0 , - 0.92 , - 0.38 , 0 , 75 , - 19.13 , 46.19 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , - 0.38 , 0.92 , 0 , 0 , - 0.92 , - 0.38 , 0 , 75 , - 50 , 0 , 1 ) "
    34 FAIL CSS Transitions: property <transform> from [rotateX(90deg) translateX(100px)] to [rotateY(0deg) translateY(200px)] at (0.25) should be [rotateX(67.5deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.38 , 0.92 , 0 , 0 , - 0.92 , 0.38 , 0 , 75 , 19.13 , 46.19 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.38 , 0.92 , 0 , 0 , - 0.92 , 0.38 , 0 , 75 , 50 , 0 , 1 ) "
    35 FAIL CSS Transitions with transition: all: property <transform> from [rotateX(90deg) translateX(100px)] to [rotateY(0deg) translateY(200px)] at (0.25) should be [rotateX(67.5deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.38 , 0.92 , 0 , 0 , - 0.92 , 0.38 , 0 , 75 , 19.13 , 46.19 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.38 , 0.92 , 0 , 0 , - 0.92 , 0.38 , 0 , 75 , 50 , 0 , 1 ) "
    36 FAIL CSS Animations: property <transform> from [rotateX(90deg) translateX(100px)] to [rotateY(0deg) translateY(200px)] at (0.25) should be [rotateX(67.5deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.38 , 0.92 , 0 , 0 , - 0.92 , 0.38 , 0 , 75 , 19.13 , 46.19 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.38 , 0.92 , 0 , 0 , - 0.92 , 0.38 , 0 , 75 , 50 , 0 , 1 ) "
    37 FAIL Web Animations: property <transform> from [rotateX(90deg) translateX(100px)] to [rotateY(0deg) translateY(200px)] at (0.25) should be [rotateX(67.5deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.38 , 0.92 , 0 , 0 , - 0.92 , 0.38 , 0 , 75 , 19.13 , 46.19 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.38 , 0.92 , 0 , 0 , - 0.92 , 0.38 , 0 , 75 , 50 , 0 , 1 ) "
    38 FAIL CSS Transitions: property <transform> from [rotate3d(1, 1, 1, -60deg) translateX(100px)] to [rotate3d(2, 2, 2, 60deg) translateY(200px)] at (0.25) should be [rotate3d(1, 1, 1, -30deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 0.91 , - 0.24 , 0.33 , 0 , 0.33 , 0.91 , - 0.24 , 0 , - 0.24 , 0.33 , 0.91 , 0 , 84.97 , 27.23 , 12.8 , 1 ) " but got "matrix3d ( 0.91 , - 0.24 , 0.33 , 0 , 0.33 , 0.91 , - 0.24 , 0 , - 0.24 , 0.33 , 0.91 , 0 , 33.33 , 8.33 , 83.33 , 1 ) "
    39 FAIL CSS Transitions with transition: all: property <transform> from [rotate3d(1, 1, 1, -60deg) translateX(100px)] to [rotate3d(2, 2, 2, 60deg) translateY(200px)] at (0.25) should be [rotate3d(1, 1, 1, -30deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 0.91 , - 0.24 , 0.33 , 0 , 0.33 , 0.91 , - 0.24 , 0 , - 0.24 , 0.33 , 0.91 , 0 , 84.97 , 27.23 , 12.8 , 1 ) " but got "matrix3d ( 0.91 , - 0.24 , 0.33 , 0 , 0.33 , 0.91 , - 0.24 , 0 , - 0.24 , 0.33 , 0.91 , 0 , 33.33 , 8.33 , 83.33 , 1 ) "
    40 FAIL CSS Animations: property <transform> from [rotate3d(1, 1, 1, -60deg) translateX(100px)] to [rotate3d(2, 2, 2, 60deg) translateY(200px)] at (0.25) should be [rotate3d(1, 1, 1, -30deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 0.91 , - 0.24 , 0.33 , 0 , 0.33 , 0.91 , - 0.24 , 0 , - 0.24 , 0.33 , 0.91 , 0 , 84.97 , 27.23 , 12.8 , 1 ) " but got "matrix3d ( 0.91 , - 0.24 , 0.33 , 0 , 0.33 , 0.91 , - 0.24 , 0 , - 0.24 , 0.33 , 0.91 , 0 , 33.33 , 8.33 , 83.33 , 1 ) "
    41 FAIL Web Animations: property <transform> from [rotate3d(1, 1, 1, -60deg) translateX(100px)] to [rotate3d(2, 2, 2, 60deg) translateY(200px)] at (0.25) should be [rotate3d(1, 1, 1, -30deg) translate(75px, 50px)] assert_equals: expected "matrix3d ( 0.91 , - 0.24 , 0.33 , 0 , 0.33 , 0.91 , - 0.24 , 0 , - 0.24 , 0.33 , 0.91 , 0 , 84.97 , 27.23 , 12.8 , 1 ) " but got "matrix3d ( 0.91 , - 0.24 , 0.33 , 0 , 0.33 , 0.91 , - 0.24 , 0 , - 0.24 , 0.33 , 0.91 , 0 , 33.33 , 8.33 , 83.33 , 1 ) "
    42 FAIL CSS Transitions: property <transform> from [rotate3d(1, 0, 0, 360deg) translateX(100px)] to [rotate3d(0, 1, 0, -720deg) translateY(200px)] at (0.25) should be [rotate3d(0, 0, 1, 0deg) translate(75px, 50px)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 75 , 50 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 75 , 50 , 0 , 1 ) "
    43 FAIL CSS Transitions with transition: all: property <transform> from [rotate3d(1, 0, 0, 360deg) translateX(100px)] to [rotate3d(0, 1, 0, -720deg) translateY(200px)] at (0.25) should be [rotate3d(0, 0, 1, 0deg) translate(75px, 50px)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 75 , 50 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 75 , 50 , 0 , 1 ) "
    44 FAIL CSS Animations: property <transform> from [rotate3d(1, 0, 0, 360deg) translateX(100px)] to [rotate3d(0, 1, 0, -720deg) translateY(200px)] at (0.25) should be [rotate3d(0, 0, 1, 0deg) translate(75px, 50px)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 75 , 50 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 75 , 50 , 0 , 1 ) "
    45 FAIL Web Animations: property <transform> from [rotate3d(1, 0, 0, 360deg) translateX(100px)] to [rotate3d(0, 1, 0, -720deg) translateY(200px)] at (0.25) should be [rotate3d(0, 0, 1, 0deg) translate(75px, 50px)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 75 , 50 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 75 , 50 , 0 , 1 ) "
     26PASS CSS Transitions: property <transform> from [translateX(100px) scaleX(3) translate(500px) scale(2)] to [translateY(200px) scale(5) translateX(100px) scaleY(3)] at (0.25) should be [translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)]
     27PASS CSS Transitions with transition: all: property <transform> from [translateX(100px) scaleX(3) translate(500px) scale(2)] to [translateY(200px) scale(5) translateX(100px) scaleY(3)] at (0.25) should be [translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)]
     28PASS CSS Animations: property <transform> from [translateX(100px) scaleX(3) translate(500px) scale(2)] to [translateY(200px) scale(5) translateX(100px) scaleY(3)] at (0.25) should be [translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)]
     29PASS Web Animations: property <transform> from [translateX(100px) scaleX(3) translate(500px) scale(2)] to [translateY(200px) scale(5) translateX(100px) scaleY(3)] at (0.25) should be [translate(75px, 50px) scale(3.5, 2) translate(400px, 0px) scale(1.75, 2.25)]
     30PASS CSS Transitions: property <transform> from [rotateX(90deg) translateX(100px)] to [rotate3d(50, 0, 0, 180deg) translateY(200px)] at (0.25) should be [rotateX(112.5deg) translate(75px, 50px)]
     31PASS CSS Transitions with transition: all: property <transform> from [rotateX(90deg) translateX(100px)] to [rotate3d(50, 0, 0, 180deg) translateY(200px)] at (0.25) should be [rotateX(112.5deg) translate(75px, 50px)]
     32PASS CSS Animations: property <transform> from [rotateX(90deg) translateX(100px)] to [rotate3d(50, 0, 0, 180deg) translateY(200px)] at (0.25) should be [rotateX(112.5deg) translate(75px, 50px)]
     33PASS Web Animations: property <transform> from [rotateX(90deg) translateX(100px)] to [rotate3d(50, 0, 0, 180deg) translateY(200px)] at (0.25) should be [rotateX(112.5deg) translate(75px, 50px)]
     34PASS CSS Transitions: property <transform> from [rotateX(90deg) translateX(100px)] to [rotateY(0deg) translateY(200px)] at (0.25) should be [rotateX(67.5deg) translate(75px, 50px)]
     35PASS CSS Transitions with transition: all: property <transform> from [rotateX(90deg) translateX(100px)] to [rotateY(0deg) translateY(200px)] at (0.25) should be [rotateX(67.5deg) translate(75px, 50px)]
     36PASS CSS Animations: property <transform> from [rotateX(90deg) translateX(100px)] to [rotateY(0deg) translateY(200px)] at (0.25) should be [rotateX(67.5deg) translate(75px, 50px)]
     37PASS Web Animations: property <transform> from [rotateX(90deg) translateX(100px)] to [rotateY(0deg) translateY(200px)] at (0.25) should be [rotateX(67.5deg) translate(75px, 50px)]
     38PASS CSS Transitions: property <transform> from [rotate3d(1, 1, 1, -60deg) translateX(100px)] to [rotate3d(2, 2, 2, 60deg) translateY(200px)] at (0.25) should be [rotate3d(1, 1, 1, -30deg) translate(75px, 50px)]
     39PASS CSS Transitions with transition: all: property <transform> from [rotate3d(1, 1, 1, -60deg) translateX(100px)] to [rotate3d(2, 2, 2, 60deg) translateY(200px)] at (0.25) should be [rotate3d(1, 1, 1, -30deg) translate(75px, 50px)]
     40PASS CSS Animations: property <transform> from [rotate3d(1, 1, 1, -60deg) translateX(100px)] to [rotate3d(2, 2, 2, 60deg) translateY(200px)] at (0.25) should be [rotate3d(1, 1, 1, -30deg) translate(75px, 50px)]
     41PASS Web Animations: property <transform> from [rotate3d(1, 1, 1, -60deg) translateX(100px)] to [rotate3d(2, 2, 2, 60deg) translateY(200px)] at (0.25) should be [rotate3d(1, 1, 1, -30deg) translate(75px, 50px)]
     42PASS CSS Transitions: property <transform> from [rotate3d(1, 0, 0, 360deg) translateX(100px)] to [rotate3d(0, 1, 0, -720deg) translateY(200px)] at (0.25) should be [rotate3d(0, 0, 1, 0deg) translate(75px, 50px)]
     43PASS CSS Transitions with transition: all: property <transform> from [rotate3d(1, 0, 0, 360deg) translateX(100px)] to [rotate3d(0, 1, 0, -720deg) translateY(200px)] at (0.25) should be [rotate3d(0, 0, 1, 0deg) translate(75px, 50px)]
     44PASS CSS Animations: property <transform> from [rotate3d(1, 0, 0, 360deg) translateX(100px)] to [rotate3d(0, 1, 0, -720deg) translateY(200px)] at (0.25) should be [rotate3d(0, 0, 1, 0deg) translate(75px, 50px)]
     45PASS Web Animations: property <transform> from [rotate3d(1, 0, 0, 360deg) translateX(100px)] to [rotate3d(0, 1, 0, -720deg) translateY(200px)] at (0.25) should be [rotate3d(0, 0, 1, 0deg) translate(75px, 50px)]
    4646FAIL CSS Transitions: property <transform> from [rotate(0deg) translate(100px)] to [rotate(720deg) scale(2) translate(200px)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1.25, 175, 0)] assert_equals: expected "matrix ( - 1.25 , 0 , 0 , - 1.25 , - 175 , 0 ) " but got "matrix ( 1.25 , 0 , 0 , 1.25 , 175 , 0 ) "
    4747FAIL CSS Transitions with transition: all: property <transform> from [rotate(0deg) translate(100px)] to [rotate(720deg) scale(2) translate(200px)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1.25, 175, 0)] assert_equals: expected "matrix ( - 1.25 , 0 , 0 , - 1.25 , - 175 , 0 ) " but got "matrix ( 1.25 , 0 , 0 , 1.25 , 175 , 0 ) "
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/matrix-interpolation-expected.txt

    r267570 r289032  
    11
    2 FAIL CSS Transitions: property <transform> from [rotateY(360deg)] to [rotateX(720deg)] at (0.5) should be [matrix(1, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 0 , 0 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 ) "
    3 FAIL CSS Transitions with transition: all: property <transform> from [rotateY(360deg)] to [rotateX(720deg)] at (0.5) should be [matrix(1, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 0 , 0 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 ) "
    4 FAIL CSS Animations: property <transform> from [rotateY(360deg)] to [rotateX(720deg)] at (0.5) should be [matrix(1, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 0 , 0 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 ) "
    5 FAIL Web Animations: property <transform> from [rotateY(360deg)] to [rotateX(720deg)] at (0.5) should be [matrix(1, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( 1 , 0 , 0 , 1 , 0 , 0 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 ) "
     2PASS CSS Transitions: property <transform> from [rotateY(360deg)] to [rotateX(720deg)] at (0.5) should be [matrix(1, 0, 0, 1, 0, 0)]
     3PASS CSS Transitions with transition: all: property <transform> from [rotateY(360deg)] to [rotateX(720deg)] at (0.5) should be [matrix(1, 0, 0, 1, 0, 0)]
     4PASS CSS Animations: property <transform> from [rotateY(360deg)] to [rotateX(720deg)] at (0.5) should be [matrix(1, 0, 0, 1, 0, 0)]
     5PASS Web Animations: property <transform> from [rotateY(360deg)] to [rotateX(720deg)] at (0.5) should be [matrix(1, 0, 0, 1, 0, 0)]
    66
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-001-expected.txt

    r286289 r289032  
    210210PASS CSS Transitions: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (-1) should be [rotateY(-900deg)]
    211211PASS CSS Transitions: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0) should be [rotateY(0deg)]
    212 FAIL CSS Transitions: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.25) should be [rotateY(225deg)] assert_equals: expected "matrix3d ( - 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) "
    213 FAIL CSS Transitions: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.75) should be [rotateY(675deg)] assert_equals: expected "matrix3d ( 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( - 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) "
     212PASS CSS Transitions: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.25) should be [rotateY(225deg)]
     213PASS CSS Transitions: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.75) should be [rotateY(675deg)]
    214214PASS CSS Transitions: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (1) should be [rotateY(900deg)]
    215215PASS CSS Transitions: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (2) should be [rotateY(1800deg)]
    216216PASS CSS Transitions with transition: all: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (-1) should be [rotateY(-900deg)]
    217217PASS CSS Transitions with transition: all: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0) should be [rotateY(0deg)]
    218 FAIL CSS Transitions with transition: all: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.25) should be [rotateY(225deg)] assert_equals: expected "matrix3d ( - 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) "
    219 FAIL CSS Transitions with transition: all: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.75) should be [rotateY(675deg)] assert_equals: expected "matrix3d ( 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( - 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) "
     218PASS CSS Transitions with transition: all: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.25) should be [rotateY(225deg)]
     219PASS CSS Transitions with transition: all: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.75) should be [rotateY(675deg)]
    220220PASS CSS Transitions with transition: all: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (1) should be [rotateY(900deg)]
    221221PASS CSS Transitions with transition: all: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (2) should be [rotateY(1800deg)]
    222222PASS CSS Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (-1) should be [rotateY(-900deg)]
    223223PASS CSS Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0) should be [rotateY(0deg)]
    224 FAIL CSS Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.25) should be [rotateY(225deg)] assert_equals: expected "matrix3d ( - 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) "
    225 FAIL CSS Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.75) should be [rotateY(675deg)] assert_equals: expected "matrix3d ( 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( - 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) "
     224PASS CSS Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.25) should be [rotateY(225deg)]
     225PASS CSS Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.75) should be [rotateY(675deg)]
    226226PASS CSS Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (1) should be [rotateY(900deg)]
    227227PASS CSS Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (2) should be [rotateY(1800deg)]
    228228PASS Web Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (-1) should be [rotateY(-900deg)]
    229229PASS Web Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0) should be [rotateY(0deg)]
    230 FAIL Web Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.25) should be [rotateY(225deg)] assert_equals: expected "matrix3d ( - 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) "
    231 FAIL Web Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.75) should be [rotateY(675deg)] assert_equals: expected "matrix3d ( 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( - 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) "
     230PASS Web Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.25) should be [rotateY(225deg)]
     231PASS Web Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (0.75) should be [rotateY(675deg)]
    232232PASS Web Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (1) should be [rotateY(900deg)]
    233233PASS Web Animations: property <transform> from [rotateX(0deg)] to [rotateY(900deg)] at (2) should be [rotateY(1800deg)]
    234234PASS CSS Transitions: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (-1) should be [rotateY(1800deg)]
    235235PASS CSS Transitions: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0) should be [rotateY(900deg)]
    236 FAIL CSS Transitions: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.25) should be [rotateY(675deg)] assert_equals: expected "matrix3d ( 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( - 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) "
    237 FAIL CSS Transitions: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.75) should be [rotateY(225deg)] assert_equals: expected "matrix3d ( - 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) "
     236PASS CSS Transitions: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.25) should be [rotateY(675deg)]
     237PASS CSS Transitions: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.75) should be [rotateY(225deg)]
    238238PASS CSS Transitions: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (1) should be [rotateY(0deg)]
    239239PASS CSS Transitions: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (2) should be [rotateY(-900deg)]
    240240PASS CSS Transitions with transition: all: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (-1) should be [rotateY(1800deg)]
    241241PASS CSS Transitions with transition: all: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0) should be [rotateY(900deg)]
    242 FAIL CSS Transitions with transition: all: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.25) should be [rotateY(675deg)] assert_equals: expected "matrix3d ( 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( - 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) "
    243 FAIL CSS Transitions with transition: all: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.75) should be [rotateY(225deg)] assert_equals: expected "matrix3d ( - 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) "
     242PASS CSS Transitions with transition: all: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.25) should be [rotateY(675deg)]
     243PASS CSS Transitions with transition: all: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.75) should be [rotateY(225deg)]
    244244PASS CSS Transitions with transition: all: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (1) should be [rotateY(0deg)]
    245245PASS CSS Transitions with transition: all: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (2) should be [rotateY(-900deg)]
    246246PASS CSS Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (-1) should be [rotateY(1800deg)]
    247247PASS CSS Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0) should be [rotateY(900deg)]
    248 FAIL CSS Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.25) should be [rotateY(675deg)] assert_equals: expected "matrix3d ( 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( - 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) "
    249 FAIL CSS Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.75) should be [rotateY(225deg)] assert_equals: expected "matrix3d ( - 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) "
     248PASS CSS Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.25) should be [rotateY(675deg)]
     249PASS CSS Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.75) should be [rotateY(225deg)]
    250250PASS CSS Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (1) should be [rotateY(0deg)]
    251251PASS CSS Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (2) should be [rotateY(-900deg)]
    252252PASS Web Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (-1) should be [rotateY(1800deg)]
    253253PASS Web Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0) should be [rotateY(900deg)]
    254 FAIL Web Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.25) should be [rotateY(675deg)] assert_equals: expected "matrix3d ( 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( - 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) "
    255 FAIL Web Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.75) should be [rotateY(225deg)] assert_equals: expected "matrix3d ( - 0.71 , 0 , 0.71 , 0 , 0 , 1 , 0 , 0 , - 0.71 , 0 , - 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0.71 , 0 , 0 , 0 , 0 , 1 ) "
     254PASS Web Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.25) should be [rotateY(675deg)]
     255PASS Web Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (0.75) should be [rotateY(225deg)]
    256256PASS Web Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (1) should be [rotateY(0deg)]
    257257PASS Web Animations: property <transform> from [rotateY(900deg)] to [rotateZ(0deg)] at (2) should be [rotateY(-900deg)]
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-002-expected.txt

    r267650 r289032  
    120120PASS Web Animations: property <transform> from [scale3d(10, 0.5, 1)] to [scale3d(20, 1, 2)] at (1) should be [scale3d(20, 1, 2)]
    121121PASS Web Animations: property <transform> from [scale3d(10, 0.5, 1)] to [scale3d(20, 1, 2)] at (2) should be [scale3d(30, 1.5, 3)]
    122 FAIL CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (-1) should be [scale(-1, 2)] assert_equals: expected "matrix ( - 1 , 0 , 0 , 2 , 0 , 0 ) " but got "matrix ( 1 , 0 , 0 , 4 , 0 , 0 ) "
     122PASS CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (-1) should be [scale(-1, 2)]
    123123PASS CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (0) should be [scale(0, 1)]
    124 FAIL CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.25) should be [scale(0.25, 0.75)] assert_equals: expected "matrix ( 0.25 , 0 , 0 , 0.75 , 0 , 0 ) " but got "matrix ( 0.06 , 0 , 0 , 0.56 , 0 , 0 ) "
    125 FAIL CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.75) should be [scale(0.75, 0.25)] assert_equals: expected "matrix ( 0.75 , 0 , 0 , 0.25 , 0 , 0 ) " but got "matrix ( 0.56 , 0 , 0 , 0.06 , 0 , 0 ) "
     124PASS CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.25) should be [scale(0.25, 0.75)]
     125PASS CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.75) should be [scale(0.75, 0.25)]
    126126PASS CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (1) should be [scale(1, 0)]
    127 FAIL CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (2) should be [scale(2, -1)] assert_equals: expected "matrix ( 2 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 4 , 0 , 0 , 1 , 0 , 0 ) "
    128 FAIL CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (-1) should be [scale(-1, 2)] assert_equals: expected "matrix ( - 1 , 0 , 0 , 2 , 0 , 0 ) " but got "matrix ( 1 , 0 , 0 , 4 , 0 , 0 ) "
     127PASS CSS Transitions: property <transform> from [scaleX(0)] to [scaleY(0)] at (2) should be [scale(2, -1)]
     128PASS CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (-1) should be [scale(-1, 2)]
    129129PASS CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (0) should be [scale(0, 1)]
    130 FAIL CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.25) should be [scale(0.25, 0.75)] assert_equals: expected "matrix ( 0.25 , 0 , 0 , 0.75 , 0 , 0 ) " but got "matrix ( 0.06 , 0 , 0 , 0.56 , 0 , 0 ) "
    131 FAIL CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.75) should be [scale(0.75, 0.25)] assert_equals: expected "matrix ( 0.75 , 0 , 0 , 0.25 , 0 , 0 ) " but got "matrix ( 0.56 , 0 , 0 , 0.06 , 0 , 0 ) "
     130PASS CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.25) should be [scale(0.25, 0.75)]
     131PASS CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.75) should be [scale(0.75, 0.25)]
    132132PASS CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (1) should be [scale(1, 0)]
    133 FAIL CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (2) should be [scale(2, -1)] assert_equals: expected "matrix ( 2 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 4 , 0 , 0 , 1 , 0 , 0 ) "
    134 FAIL CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (-1) should be [scale(-1, 2)] assert_equals: expected "matrix ( - 1 , 0 , 0 , 2 , 0 , 0 ) " but got "matrix ( 1 , 0 , 0 , 4 , 0 , 0 ) "
     133PASS CSS Transitions with transition: all: property <transform> from [scaleX(0)] to [scaleY(0)] at (2) should be [scale(2, -1)]
     134PASS CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (-1) should be [scale(-1, 2)]
    135135PASS CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0) should be [scale(0, 1)]
    136 FAIL CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.25) should be [scale(0.25, 0.75)] assert_equals: expected "matrix ( 0.25 , 0 , 0 , 0.75 , 0 , 0 ) " but got "matrix ( 0.06 , 0 , 0 , 0.56 , 0 , 0 ) "
    137 FAIL CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.75) should be [scale(0.75, 0.25)] assert_equals: expected "matrix ( 0.75 , 0 , 0 , 0.25 , 0 , 0 ) " but got "matrix ( 0.56 , 0 , 0 , 0.06 , 0 , 0 ) "
     136PASS CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.25) should be [scale(0.25, 0.75)]
     137PASS CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.75) should be [scale(0.75, 0.25)]
    138138PASS CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (1) should be [scale(1, 0)]
    139 FAIL CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (2) should be [scale(2, -1)] assert_equals: expected "matrix ( 2 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 4 , 0 , 0 , 1 , 0 , 0 ) "
    140 FAIL Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (-1) should be [scale(-1, 2)] assert_equals: expected "matrix ( - 1 , 0 , 0 , 2 , 0 , 0 ) " but got "matrix ( 1 , 0 , 0 , 4 , 0 , 0 ) "
     139PASS CSS Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (2) should be [scale(2, -1)]
     140PASS Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (-1) should be [scale(-1, 2)]
    141141PASS Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0) should be [scale(0, 1)]
    142 FAIL Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.25) should be [scale(0.25, 0.75)] assert_equals: expected "matrix ( 0.25 , 0 , 0 , 0.75 , 0 , 0 ) " but got "matrix ( 0.06 , 0 , 0 , 0.56 , 0 , 0 ) "
    143 FAIL Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.75) should be [scale(0.75, 0.25)] assert_equals: expected "matrix ( 0.75 , 0 , 0 , 0.25 , 0 , 0 ) " but got "matrix ( 0.56 , 0 , 0 , 0.06 , 0 , 0 ) "
     142PASS Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.25) should be [scale(0.25, 0.75)]
     143PASS Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (0.75) should be [scale(0.75, 0.25)]
    144144PASS Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (1) should be [scale(1, 0)]
    145 FAIL Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (2) should be [scale(2, -1)] assert_equals: expected "matrix ( 2 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 4 , 0 , 0 , 1 , 0 , 0 ) "
     145PASS Web Animations: property <transform> from [scaleX(0)] to [scaleY(0)] at (2) should be [scale(2, -1)]
    146146PASS CSS Transitions: property <transform> from [none] to [scale3d(2, 3, 5)] at (-1) should be [scale3d(0, -1, -3)]
    147147PASS CSS Transitions: property <transform> from [none] to [scale3d(2, 3, 5)] at (0) should be [scale3d(1, 1, 1)]
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-inline-value-expected.txt

    r287909 r289032  
    1717FAIL Interpolation between rotate(0deg) and rotateZ(90deg) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "rotate3d(0, 0, 1, 45deg)" but got "matrix(0.707107, 0.707107, -0.707107, 0.707107, 0, 0)"
    1818FAIL Interpolation between rotateX(0deg) and rotateX(90deg) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "rotateX(45deg)" but got "matrix3d(1, 0, 0, 0, 0, 0.707107, 0.707107, 0, 0, -0.707107, 0.707107, 0, 0, 0, 0, 1)"
    19 FAIL Interpolation between rotate(0deg) and rotateX(90deg) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "rotate3d(1, 0, 0, 45deg)" but got "matrix3d(1, 0, 0, 0, 0, 0.5, 0.5, 0, 0, -0.5, 0.5, 0, 0, 0, 0, 1)"
     19FAIL Interpolation between rotate(0deg) and rotateX(90deg) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "rotate3d(1, 0, 0, 45deg)" but got "matrix3d(1, 0, 0, 0, 0, 0.707107, 0.707107, 0, 0, -0.707107, 0.707107, 0, 0, 0, 0, 1)"
    2020FAIL Interpolation between scale(1) and scale(2) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scale(1.5)" but got "matrix(1.5, 0, 0, 1.5, 0, 0)"
    2121FAIL Interpolation between scale(1, 3) and scale(2) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "scale(1.5, 2.5)" but got "matrix(1.5, 0, 0, 2.5, 0, 0)"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-verify-reftests-expected.txt

    r286591 r289032  
    7272PASS CSS Animations: property <transform> from [rotateX(0deg)] to [rotate(90deg)] at (0.5) should be [rotate(45deg)]
    7373PASS Web Animations: property <transform> from [rotateX(0deg)] to [rotate(90deg)] at (0.5) should be [rotate(45deg)]
    74 FAIL CSS Transitions: property <transform> from [rotateX(90deg)] to [rotate(0deg)] at (0.5) should be [rotateX(45deg)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.71 , 0.71 , 0 , 0 , - 0.71 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.5 , 0.5 , 0 , 0 , - 0.5 , 0.5 , 0 , 0 , 0 , 0 , 1 ) "
    75 FAIL CSS Transitions with transition: all: property <transform> from [rotateX(90deg)] to [rotate(0deg)] at (0.5) should be [rotateX(45deg)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.71 , 0.71 , 0 , 0 , - 0.71 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.5 , 0.5 , 0 , 0 , - 0.5 , 0.5 , 0 , 0 , 0 , 0 , 1 ) "
    76 FAIL CSS Animations: property <transform> from [rotateX(90deg)] to [rotate(0deg)] at (0.5) should be [rotateX(45deg)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.71 , 0.71 , 0 , 0 , - 0.71 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.5 , 0.5 , 0 , 0 , - 0.5 , 0.5 , 0 , 0 , 0 , 0 , 1 ) "
    77 FAIL Web Animations: property <transform> from [rotateX(90deg)] to [rotate(0deg)] at (0.5) should be [rotateX(45deg)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.71 , 0.71 , 0 , 0 , - 0.71 , 0.71 , 0 , 0 , 0 , 0 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0.5 , 0.5 , 0 , 0 , - 0.5 , 0.5 , 0 , 0 , 0 , 0 , 1 ) "
     74PASS CSS Transitions: property <transform> from [rotateX(90deg)] to [rotate(0deg)] at (0.5) should be [rotateX(45deg)]
     75PASS CSS Transitions with transition: all: property <transform> from [rotateX(90deg)] to [rotate(0deg)] at (0.5) should be [rotateX(45deg)]
     76PASS CSS Animations: property <transform> from [rotateX(90deg)] to [rotate(0deg)] at (0.5) should be [rotateX(45deg)]
     77PASS Web Animations: property <transform> from [rotateX(90deg)] to [rotate(0deg)] at (0.5) should be [rotateX(45deg)]
    7878FAIL CSS Transitions: property <transform> from [rotateX(360deg)] to [rotateZ(90deg)] at (0.5) should be [rotateZ(45deg)] assert_equals: expected "matrix ( 0.71 , 0.71 , - 0.71 , 0.71 , 0 , 0 ) " but got "matrix3d ( 0.71 , 0.71 , 0 , 0 , - 0.71 , 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 ) "
    7979FAIL CSS Transitions with transition: all: property <transform> from [rotateX(360deg)] to [rotateZ(90deg)] at (0.5) should be [rotateZ(45deg)] assert_equals: expected "matrix ( 0.71 , 0.71 , - 0.71 , 0.71 , 0 , 0 ) " but got "matrix3d ( 0.71 , 0.71 , 0 , 0 , - 0.71 , 0.71 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 ) "
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-translate-composition-expected.txt

    r285631 r289032  
    4242PASS Compositing: property <transform> underlying [translateZ(100px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (1) should be [translateZ(350px)]
    4343PASS Compositing: property <transform> underlying [translateZ(100px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (1.5) should be [translateZ(450px)]
    44 FAIL Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (-0.5) should be [translate3d(100px, 50px, -50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 100 , 50 , - 50 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , - 50 , 1 ) "
    45 FAIL Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (0) should be [translate3d(100px, 50px, 50px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 100 , 50 , 50 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 50 , 1 ) "
    46 FAIL Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (0.25) should be [translate3d(100px, 50px, 100px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 100 , 50 , 100 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 100 , 1 ) "
    47 FAIL Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (0.5) should be [translate3d(100px, 50px, 150px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 100 , 50 , 150 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 150 , 1 ) "
    48 FAIL Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (0.75) should be [translate3d(100px, 50px, 200px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 100 , 50 , 200 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 200 , 1 ) "
    49 FAIL Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (1) should be [translate3d(100px, 50px, 250px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 100 , 50 , 250 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 250 , 1 ) "
    50 FAIL Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (1.5) should be [translate3d(100px, 50px, 350px)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 100 , 50 , 350 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 350 , 1 ) "
     44PASS Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (-0.5) should be [translate3d(100px, 50px, -50px)]
     45PASS Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (0) should be [translate3d(100px, 50px, 50px)]
     46PASS Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (0.25) should be [translate3d(100px, 50px, 100px)]
     47PASS Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (0.5) should be [translate3d(100px, 50px, 150px)]
     48PASS Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (0.75) should be [translate3d(100px, 50px, 200px)]
     49PASS Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (1) should be [translate3d(100px, 50px, 250px)]
     50PASS Compositing: property <transform> underlying [translate(100px, 50px)] from accumulate [translateZ(50px)] to accumulate [translateZ(250px)] at (1.5) should be [translate3d(100px, 50px, 350px)]
    5151FAIL 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 ) "
    5252FAIL 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 ) "
  • trunk/Source/WebCore/ChangeLog

    r289031 r289032  
     12022-02-03  Martin Robinson  <mrobinson@webkit.org>
     2
     3        Transform interpolation should blend between shared transform function primitives
     4        https://bugs.webkit.org/show_bug.cgi?id=235311
     5        <rdar://problem/88012700>
     6
     7        Reviewed by Simon Fraser.
     8
     9        No new tests. This is covered by existing WPT tests.
     10
     11        Allow direct interpolation between mismatching transform functions that share a primitive.
     12        This fixes many tests expecting a certain computed transformation matrix in WPT, but also
     13        allows using hardware animations more often for the CoreAnimation backend.
     14
     15        Rotation, scale, and translate are the only functions that have shared primitives, so they
     16        are the only ones in this change to allow for this new behavior.
     17
     18        When determining if a list of keyframes has shared compatible lists of transforms, return
     19        the vector of primitives that can represent them. In addition code for calculating big
     20        rotations has been removed, because it was unused.
     21
     22        * platform/graphics/GraphicsLayer.cpp:
     23        (WebCore::gSharedPrimitivesForTransformKeyframe): Added.
     24        (WebCore::GraphicsLayer::getSharedPrimitivesForTransformKeyframes): Added.
     25        * platform/graphics/GraphicsLayer.h:
     26        * platform/graphics/ca/GraphicsLayerCA.cpp:
     27        (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Modified to take a vector of shared
     28        primitive types instead of a pointer to an array of operations.
     29        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
     30        * platform/graphics/ca/GraphicsLayerCA.h:
     31        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
     32        (WebCore::GraphicsLayerTextureMapper::addAnimation): Use new method.
     33        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
     34        (WebCore::CoordinatedGraphicsLayer::addAnimation): Ditto.
     35        * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
     36        (WebCore::Matrix3DTransformOperation::blend): Use the new sharedPrimitiveType method
     37        to determine if the two operations can blend.
     38        * platform/graphics/transforms/MatrixTransformOperation.cpp:
     39        (WebCore::MatrixTransformOperation::blend): Ditto.
     40        * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
     41        (WebCore::PerspectiveTransformOperation::blend): Ditto.
     42        * platform/graphics/transforms/RotateTransformOperation.cpp:
     43        (WebCore::RotateTransformOperation::blend): Ditto.
     44        * platform/graphics/transforms/RotateTransformOperation.h:
     45        * platform/graphics/transforms/ScaleTransformOperation.cpp:
     46        (WebCore::ScaleTransformOperation::blend): Ditto.
     47        * platform/graphics/transforms/ScaleTransformOperation.h:
     48        * platform/graphics/transforms/SkewTransformOperation.cpp:
     49        (WebCore::SkewTransformOperation::blend): Ditto.
     50        * platform/graphics/transforms/TransformOperation.cpp:
     51        (WebCore::TransformOperation::sharedPrimitiveType const):
     52        * platform/graphics/transforms/TransformOperation.h:
     53        (WebCore::TransformOperation::primitiveType const): Added this virtual function which
     54        return the type for the base class. Rotation, scale, and translate specialize this to
     55        return a compatible primitive type.
     56        * platform/graphics/transforms/TransformOperations.cpp:
     57        (WebCore::TransformOperations::operationsMatch const): Modified to check whether operations
     58        share primitives.
     59        * platform/graphics/transforms/TranslateTransformOperation.cpp:
     60        (WebCore::TranslateTransformOperation::blend): Use the new sharedPrimitiveType method.
     61        * platform/graphics/transforms/TranslateTransformOperation.h:
     62
    1632022-02-03  Tim Nguyen  <ntim@apple.com>
    264
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r286943 r289032  
    711711}
    712712
    713 // An "invalid" list is one whose functions don't match, and therefore has to be animated as a Matrix
    714 // The hasBigRotation flag will always return false if isValid is false. Otherwise hasBigRotation is
    715 // true if the rotation between any two keyframes is >= 180 degrees.
    716 
    717713static inline const TransformOperations& operationsAt(const KeyframeValueList& valueList, size_t index)
    718714{
     
    720716}
    721717
    722 int GraphicsLayer::validateTransformOperations(const KeyframeValueList& valueList, bool& hasBigRotation)
     718// A sequence of keyframes with a list of transforms can be represented without matrix interpolation
     719// if each transform is compatible with all other transforms at the same index in other keyframes.
     720// Two transforms are compatible if they share a primitive defined by the CSS Transforms Level 2
     721// specification. For instance, the shared primitive of a translateX and translate3D operation is
     722// TransformOperation::TRANSLATE_3D. This function returns true if the TransformOperations in each
     723// keyframe share a primitive operation type and stores the compatible OperationTypes in
     724// sharedPrimitives. If the keyframes do not share a list of compatible primitives, false is
     725// returned.
     726bool GraphicsLayer::getSharedPrimitivesForTransformKeyframes(const KeyframeValueList& valueList, Vector<TransformOperation::OperationType>& sharedPrimitives)
    723727{
    724728    ASSERT(animatedPropertyIsTransformOrRelated(valueList.property()));
    725729
    726     hasBigRotation = false;
    727    
    728730    if (valueList.size() < 2)
    729         return -1;
    730    
    731     // Empty transforms match anything, so find the first non-empty entry as the reference.
    732     size_t firstIndex = 0;
    733     for ( ; firstIndex < valueList.size(); ++firstIndex) {
    734         if (!operationsAt(valueList, firstIndex).operations().isEmpty())
    735             break;
    736     }
    737    
    738     if (firstIndex >= valueList.size())
    739         return -1;
    740        
    741     const TransformOperations& firstVal = operationsAt(valueList, firstIndex);
    742    
    743     // See if the keyframes are valid.
    744     for (size_t i = firstIndex + 1; i < valueList.size(); ++i) {
    745         const TransformOperations& val = operationsAt(valueList, i);
    746        
    747         // An empty transform list matches anything.
    748         if (val.operations().isEmpty())
    749             continue;
    750            
    751         if (!firstVal.operationsMatch(val))
    752             return -1;
    753     }
    754 
    755     // Keyframes are valid, check for big rotations.   
    756     double lastRotationAngle = 0.0;
    757     double maxRotationAngle = -1.0;
    758        
    759     for (size_t j = 0; j < firstVal.operations().size(); ++j) {
    760         TransformOperation::OperationType type = firstVal.operations().at(j)->type();
    761        
    762         // if this is a rotation entry, we need to see if any angle differences are >= 180 deg
    763         if (type == TransformOperation::ROTATE_X ||
    764             type == TransformOperation::ROTATE_Y ||
    765             type == TransformOperation::ROTATE_Z ||
    766             type == TransformOperation::ROTATE_3D) {
    767             lastRotationAngle = downcast<RotateTransformOperation>(*firstVal.operations().at(j)).angle();
    768            
    769             if (maxRotationAngle < 0)
    770                 maxRotationAngle = fabs(lastRotationAngle);
    771            
    772             for (size_t i = firstIndex + 1; i < valueList.size(); ++i) {
    773                 const TransformOperations& val = operationsAt(valueList, i);
    774                 double rotationAngle = val.operations().isEmpty() ? 0 : downcast<RotateTransformOperation>(*val.operations().at(j)).angle();
    775                 double diffAngle = fabs(rotationAngle - lastRotationAngle);
    776                 if (diffAngle > maxRotationAngle)
    777                     maxRotationAngle = diffAngle;
    778                 lastRotationAngle = rotationAngle;
     731        return false;
     732
     733    sharedPrimitives.clear();
     734    sharedPrimitives.reserveInitialCapacity(operationsAt(valueList, 0).size());
     735
     736    // Find a list of transform primitives for the given TransformOperations which are compatible with the primitives
     737    // stored in sharedPrimitives. The results are written back into sharedPrimitives. This returns false if any element
     738    // of TransformOperation does not have a shared primitive, otherwise it returns true.
     739    auto updateSharedPrimitives = [&](const TransformOperations& operations) {
     740        // Empty transform lists are implicitly a list of identity transforms.
     741        if (!operations.size())
     742            return true;
     743
     744        // If we have seen a non-empty list already and this list's size doesn't match, then we can't use shared
     745        // primitives. FIXME: This should handle prefix matches and then fall back to matrix interpolation for the rest
     746        // of the list.
     747        // See: https://bugs.webkit.org/show_bug.cgi?id=235757
     748        if (sharedPrimitives.size() && sharedPrimitives.size() != operations.size())
     749            return false;
     750
     751        for (size_t i = 0; i < operations.size(); ++i) {
     752            const auto* operation = operations.at(i);
     753
     754            // If we haven't seen an operation at this index before, we can simply use our primitive type.
     755            if (i >= sharedPrimitives.size()) {
     756                ASSERT(i == sharedPrimitives.size());
     757                sharedPrimitives.append(operation->primitiveType());
     758                continue;
    779759            }
     760
     761            if (auto sharedPrimitive = operation->sharedPrimitiveType(sharedPrimitives[i]))
     762                sharedPrimitives[i] = *sharedPrimitive;
     763            else
     764                return false;
    780765        }
    781     }
    782    
    783     hasBigRotation = maxRotationAngle >= 180.0;
    784    
    785     return firstIndex;
     766
     767        return true;
     768    };
     769
     770    for (size_t i = 0; i < valueList.size(); ++i) {
     771        const TransformOperations& operations = operationsAt(valueList, i);
     772        if (!updateSharedPrimitives(operations))
     773            return false;
     774    }
     775
     776    return true;
    786777}
    787778
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r286943 r289032  
    665665    static int validateFilterOperations(const KeyframeValueList&);
    666666
    667     // Given a list of TransformAnimationValues, see if all the operations for each keyframe match. If so
    668     // return the index of the KeyframeValueList entry that has that list of operations (it may not be
    669     // the first entry because some keyframes might have an empty transform and those match any list).
    670     // If the lists don't match return -1. On return, if hasBigRotation is true, functions contain
    671     // rotations of >= 180 degrees
    672     static int validateTransformOperations(const KeyframeValueList&, bool& hasBigRotation);
     667    // Given a list of TransformAnimationValues keyframes, place a list of primitive operations which can
     668    // represent the transform functions of every keyframe in the sharedPrimitives out parameter and return
     669    // true. If the keyframes do not share compatible functions, return false.
     670    static bool getSharedPrimitivesForTransformKeyframes(const KeyframeValueList&, Vector<TransformOperation::OperationType>& sharedPrimitives);
    673671
    674672    virtual bool shouldRepaintOnSizeChange() const { return drawsContent(); }
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r288950 r289032  
    34593459}
    34603460
    3461 bool GraphicsLayerCA::appendToUncommittedAnimations(const KeyframeValueList& valueList, const TransformOperations* operations, const Animation* animation, const String& animationName, const FloatSize& boxSize, int animationIndex, Seconds timeOffset, bool isMatrixAnimation, bool keyframesShouldUseAnimationWideTimingFunction)
    3462 {
    3463     TransformOperation::OperationType transformOp = isMatrixAnimation ? TransformOperation::MATRIX_3D : operations->operations().at(animationIndex)->type();
     3461bool GraphicsLayerCA::appendToUncommittedAnimations(const KeyframeValueList& valueList, const Vector<TransformOperation::OperationType>& operations, const Animation* animation, const String& animationName, const FloatSize& boxSize, unsigned animationIndex, Seconds timeOffset, bool isMatrixAnimation, bool keyframesShouldUseAnimationWideTimingFunction)
     3462{
     3463    // If function lists don't match we do a matrix animation, otherwise we do a component hardware animation.
     3464    auto transformOp = isMatrixAnimation ? TransformOperation::MATRIX_3D : operations[animationIndex];
    34643465
    34653466    RefPtr<PlatformCAAnimation> caAnimation;
     
    34873488    ASSERT(animatedPropertyIsTransformOrRelated(valueList.property()));
    34883489
    3489     bool hasBigRotation;
    3490     int listIndex = validateTransformOperations(valueList, hasBigRotation);
    3491     const TransformOperations* operations = (listIndex >= 0) ? &static_cast<const TransformAnimationValue&>(valueList.at(listIndex)).value() : 0;
     3490    Vector<TransformOperation::OperationType> sharedPrimitives;
     3491    bool isMatrixAnimation = !getSharedPrimitivesForTransformKeyframes(valueList, sharedPrimitives);
     3492    unsigned numOperations = !isMatrixAnimation ? sharedPrimitives.size() : 1;
    34923493
    34933494    bool validMatrices = true;
    3494 
    3495     // If function lists don't match we do a matrix animation, otherwise we do a component hardware animation.
    3496     bool isMatrixAnimation = valueList.property() == AnimatedPropertyTransform ? listIndex < 0 : true;
    3497     int numAnimations = isMatrixAnimation ? 1 : operations->size();
    3498 
    3499     for (int animationIndex = 0; animationIndex < numAnimations; ++animationIndex) {
    3500         if (!appendToUncommittedAnimations(valueList, operations, animation, animationName, boxSize, animationIndex, timeOffset, isMatrixAnimation, keyframesShouldUseAnimationWideTimingFunction)) {
     3495    for (unsigned animationIndex = 0; animationIndex < numOperations; ++animationIndex) {
     3496        if (!appendToUncommittedAnimations(valueList, sharedPrimitives, animation, animationName, boxSize, animationIndex, timeOffset, isMatrixAnimation, keyframesShouldUseAnimationWideTimingFunction)) {
    35013497            validMatrices = false;
    35023498            break;
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r286943 r289032  
    531531    }
    532532
    533     bool appendToUncommittedAnimations(const KeyframeValueList&, const TransformOperations*, const Animation*, const String& animationName, const FloatSize& boxSize, int animationIndex, Seconds timeOffset, bool isMatrixAnimation, bool keyframesShouldUseAnimationWideTimingFunction);
     533    bool appendToUncommittedAnimations(const KeyframeValueList&, const Vector<TransformOperation::OperationType>& operations, const Animation*, const String& animationName, const FloatSize& boxSize, unsigned animationIndex, Seconds timeOffset, bool isMatrixAnimation, bool keyframesShouldUseAnimationWideTimingFunction);
    534534    bool appendToUncommittedAnimations(const KeyframeValueList&, const FilterOperation*, const Animation*, const String& animationName, int animationIndex, Seconds timeOffset, bool keyframesShouldUseAnimationWideTimingFunction);
    535535
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp

    r286943 r289032  
    2525#include "ImageBuffer.h"
    2626#include "NicosiaAnimation.h"
     27#include "TransformOperation.h"
    2728
    2829#if !USE(COORDINATED_GRAPHICS)
     
    612613
    613614    bool listsMatch = false;
    614     bool hasBigRotation;
    615 
    616     if (valueList.property() == AnimatedPropertyTransform)
    617         listsMatch = validateTransformOperations(valueList, hasBigRotation) >= 0;
     615    if (valueList.property() == AnimatedPropertyTransform) {
     616        Vector<TransformOperation::OperationType> unusedOperations;
     617        listsMatch = !!getSharedPrimitivesForTransformKeyframes(valueList, unusedOperations);
     618    }
    618619
    619620    const MonotonicTime currentTime = MonotonicTime::now();
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

    r288541 r289032  
    4141#include "TextureMapperPlatformLayerProxyProvider.h"
    4242#include "TiledBackingStore.h"
     43#include "TransformOperation.h"
    4344#ifndef NDEBUG
    4445#include <wtf/SetForScope.h>
     
    14151416    }
    14161417    case AnimatedPropertyTransform: {
    1417         bool ignoredHasBigRotation;
    1418         listsMatch = validateTransformOperations(valueList, ignoredHasBigRotation) >= 0;
     1418        Vector<TransformOperation::OperationType> unusedOperations;
     1419        listsMatch = !!getSharedPrimitivesForTransformKeyframes(valueList, unusedOperations);
    14191420        break;
    14201421    }
  • trunk/Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.cpp

    r276141 r289032  
    4646Ref<TransformOperation> Matrix3DTransformOperation::blend(const TransformOperation* from, const BlendingContext& context, bool blendToIdentity)
    4747{
    48     if (from && !from->isSameType(*this))
     48    if (!sharedPrimitiveType(from))
    4949        return *this;
    5050
  • trunk/Source/WebCore/platform/graphics/transforms/MatrixTransformOperation.cpp

    r276141 r289032  
    4444    };
    4545
    46     if (from && !from->isSameType(*this))
     46    if (!sharedPrimitiveType(from))
    4747        return *this;
    4848
  • trunk/Source/WebCore/platform/graphics/transforms/PerspectiveTransformOperation.cpp

    r286289 r289032  
    4242Ref<TransformOperation> PerspectiveTransformOperation::blend(const TransformOperation* from, const BlendingContext& context, bool blendToIdentity)
    4343{
    44     if (from && !from->isSameType(*this))
     44    if (!sharedPrimitiveType(from))
    4545        return *this;
    4646
  • trunk/Source/WebCore/platform/graphics/transforms/RotateTransformOperation.cpp

    r285397 r289032  
    4040Ref<TransformOperation> RotateTransformOperation::blend(const TransformOperation* from, const BlendingContext& context, bool blendToIdentity)
    4141{
    42     if (from && !from->isSameType(*this))
    43         return *this;
    44    
    4542    if (blendToIdentity)
    4643        return RotateTransformOperation::create(m_x, m_y, m_z, m_angle - m_angle * context.progress, type());
    47    
     44
     45    auto outputType = sharedPrimitiveType(from);
     46    if (!outputType)
     47        return *this;
     48
    4849    const RotateTransformOperation* fromOp = downcast<RotateTransformOperation>(from);
    4950    const RotateTransformOperation* toOp = this;
     
    7071    if (!fromAngle || !toAngle || fromNormalizedVector == toNormalizedVector) {
    7172        auto vector = (!fromAngle && toAngle) ? toNormalizedVector : fromNormalizedVector;
    72         return RotateTransformOperation::create(vector.x(), vector.y(), vector.z(), WebCore::blend(fromAngle, toAngle, context), type());
     73        return RotateTransformOperation::create(vector.x(), vector.y(), vector.z(), WebCore::blend(fromAngle, toAngle, context), *outputType);
    7374    }
    7475
  • trunk/Source/WebCore/platform/graphics/transforms/RotateTransformOperation.h

    r286816 r289032  
    5454    double angle() const { return m_angle; }
    5555
     56    // The 2D rotation primitive doesn't handle any direction vectors other than [0, 0, 1],
     57    // so even if the rotation is representable in 2D, it might be a 3D rotation.
     58    OperationType primitiveType() const final { return (isRepresentableIn2D() && z() == 1.0) ? ROTATE : ROTATE_3D; }
     59
    5660    bool operator==(const RotateTransformOperation& other) const { return operator==(static_cast<const TransformOperation&>(other)); }
    5761    bool operator==(const TransformOperation&) const override;
  • trunk/Source/WebCore/platform/graphics/transforms/ScaleTransformOperation.cpp

    r285694 r289032  
    5353Ref<TransformOperation> ScaleTransformOperation::blend(const TransformOperation* from, const BlendingContext& context, bool blendToIdentity)
    5454{
    55     if (from && !is<ScaleTransformOperation>(from))
     55    if (blendToIdentity)
     56        return ScaleTransformOperation::create(blendScaleComponent(m_x, 1.0, context), blendScaleComponent(m_y, 1.0, context), blendScaleComponent(m_z, 1.0, context), type());
     57
     58    auto outputType = sharedPrimitiveType(from);
     59    if (!outputType)
    5660        return *this;
    5761
    58     if (blendToIdentity)
    59         return ScaleTransformOperation::create(blendScaleComponent(m_x, 1.0, context),
    60                                                blendScaleComponent(m_y, 1.0, context),
    61                                                blendScaleComponent(m_z, 1.0, context), type());
    62    
    6362    const ScaleTransformOperation* fromOp = downcast<ScaleTransformOperation>(from);
    6463    double fromX = fromOp ? fromOp->m_x : 1.0;
    6564    double fromY = fromOp ? fromOp->m_y : 1.0;
    6665    double fromZ = fromOp ? fromOp->m_z : 1.0;
    67     return ScaleTransformOperation::create(blendScaleComponent(fromX, m_x, context),
    68                                            blendScaleComponent(fromY, m_y, context),
    69                                            blendScaleComponent(fromZ, m_z, context), type());
     66    return ScaleTransformOperation::create(blendScaleComponent(fromX, m_x, context), blendScaleComponent(fromY, m_y, context), blendScaleComponent(fromZ, m_z, context), *outputType);
    7067}
    7168
  • trunk/Source/WebCore/platform/graphics/transforms/ScaleTransformOperation.h

    r286816 r289032  
    5353    double z() const { return m_z; }
    5454
     55    OperationType primitiveType() const final { return isRepresentableIn2D() ? SCALE : SCALE_3D; }
     56
    5557    bool operator==(const ScaleTransformOperation& other) const { return operator==(static_cast<const TransformOperation&>(other)); }
    5658    bool operator==(const TransformOperation&) const final;
  • trunk/Source/WebCore/platform/graphics/transforms/SkewTransformOperation.cpp

    r276141 r289032  
    3838Ref<TransformOperation> SkewTransformOperation::blend(const TransformOperation* from, const BlendingContext& context, bool blendToIdentity)
    3939{
    40     if (from && !from->isSameType(*this))
    41         return *this;
    42    
    4340    if (blendToIdentity)
    4441        return SkewTransformOperation::create(WebCore::blend(m_angleX, 0.0, context), WebCore::blend(m_angleY, 0.0, context), type());
    45    
     42
     43    auto outputType = sharedPrimitiveType(from);
     44    if (!outputType)
     45        return *this;
     46
    4647    const SkewTransformOperation* fromOp = downcast<SkewTransformOperation>(from);
    4748    double fromAngleX = fromOp ? fromOp->m_angleX : 0;
    4849    double fromAngleY = fromOp ? fromOp->m_angleY : 0;
    49     return SkewTransformOperation::create(WebCore::blend(fromAngleX, m_angleX, context), WebCore::blend(fromAngleY, m_angleY, context), type());
     50    return SkewTransformOperation::create(WebCore::blend(fromAngleX, m_angleX, context), WebCore::blend(fromAngleY, m_angleY, context), *outputType);
    5051}
    5152
  • trunk/Source/WebCore/platform/graphics/transforms/TransformOperation.cpp

    r220503 r289032  
    7373}
    7474
     75std::optional<TransformOperation::OperationType> TransformOperation::sharedPrimitiveType(OperationType other) const
     76{
     77    // https://drafts.csswg.org/css-transforms-2/#interpolation-of-transform-functions
     78    // "If both transform functions share a primitive in the two-dimensional space, both transform
     79    // functions get converted to the two-dimensional primitive. If one or both transform functions
     80    // are three-dimensional transform functions, the common three-dimensional primitive is used."
     81    auto type = primitiveType();
     82    if (type == other)
     83        return type;
     84    static constexpr OperationType sharedPrimitives[][2] = {
     85        { ROTATE, ROTATE_3D },
     86        { SCALE, SCALE_3D },
     87        { TRANSLATE, TRANSLATE_3D }
     88    };
     89    for (auto typePair : sharedPrimitives) {
     90        if ((type == typePair[0] || type == typePair[1]) && (other == typePair[0] || other == typePair[1]))
     91            return typePair[1];
     92    }
     93    return std::nullopt;
     94}
     95
     96std::optional<TransformOperation::OperationType> TransformOperation::sharedPrimitiveType(const TransformOperation* other) const
     97{
     98    // Blending with a null operation is always supported via blending with identity.
     99    return other ? sharedPrimitiveType(other->primitiveType()) : primitiveType();
     100}
     101
    75102} // namespace WebCore
  • trunk/Source/WebCore/platform/graphics/transforms/TransformOperation.h

    r284600 r289032  
    7474    bool isSameType(const TransformOperation& other) const { return type() == other.type(); }
    7575
     76    virtual OperationType primitiveType() const { return m_type; }
     77    std::optional<OperationType> sharedPrimitiveType(OperationType other) const;
     78    std::optional<OperationType> sharedPrimitiveType(const TransformOperation* other) const;
     79
    7680    virtual bool isAffectedByTransformOrigin() const { return false; }
    7781   
  • trunk/Source/WebCore/platform/graphics/transforms/TransformOperations.cpp

    r276141 r289032  
    6060    // If the types of each function are not the same, the lists don't match
    6161    for (size_t i = 0; i < numOperations; ++i) {
    62         if (!operations()[i]->isSameType(*other.operations()[i]))
     62        if (!operations()[i]->sharedPrimitiveType(other.operations()[i].get()))
    6363            return false;
    6464    }
  • trunk/Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.cpp

    r276141 r289032  
    3939Ref<TransformOperation> TranslateTransformOperation::blend(const TransformOperation* from, const BlendingContext& context, bool blendToIdentity)
    4040{
    41     if (from && !from->isSameType(*this))
    42         return *this;
    43 
    4441    Length zeroLength(0, LengthType::Fixed);
    4542    if (blendToIdentity)
    4643        return TranslateTransformOperation::create(WebCore::blend(m_x, zeroLength, context), WebCore::blend(m_y, zeroLength, context), WebCore::blend(m_z, zeroLength, context), type());
     44
     45    auto outputType = sharedPrimitiveType(from);
     46    if (!outputType)
     47        return *this;
    4748
    4849    const TranslateTransformOperation* fromOp = downcast<TranslateTransformOperation>(from);
     
    5051    Length fromY = fromOp ? fromOp->m_y : zeroLength;
    5152    Length fromZ = fromOp ? fromOp->m_z : zeroLength;
    52     return TranslateTransformOperation::create(WebCore::blend(fromX, x(), context), WebCore::blend(fromY, y(), context), WebCore::blend(fromZ, z(), context), type());
     53    return TranslateTransformOperation::create(WebCore::blend(fromX, x(), context), WebCore::blend(fromY, y(), context), WebCore::blend(fromZ, z(), context), *outputType);
    5354}
    5455
  • trunk/Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h

    r286816 r289032  
    5959    Length z() const { return m_z; }
    6060
     61    OperationType primitiveType() const final { return isRepresentableIn2D() ? TRANSLATE : TRANSLATE_3D; }
     62
    6163    bool apply(TransformationMatrix& transform, const FloatSize& borderBoxSize) const final
    6264    {
Note: See TracChangeset for help on using the changeset viewer.