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

Changeset 290667 in webkit


Ignore:
Timestamp:
Mar 1, 2022, 12:01:25 PM (5 years ago)
Author:
Martin Robinson
Message:

When interpolating between transform lists partial prefix matches should not use matrix interpolation
​https://bugs.webkit.org/show_bug.cgi?id=235757
<rdar://problem/88477922>

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-transforms/animation/list-interpolation-expected.txt: Mark subtests as passing.
  • web-platform-tests/css/css-transforms/animation/transform-composition-expected.txt: Ditto.
  • web-platform-tests/css/css-transforms/animation/transform-interpolation-004-expected.txt: Ditto.

Source/WebCore:

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

When interpolation between keyframes in transform animations, interpolate prefixes of
compatible transform functions directly. For instance if there are three keyframes:

  1. transform: rotateX(...) translateY(...) skew(...)
  2. transform: rotateY(...) translateY(...)
  3. transform: rotateZ(...) translateZ(...) matrix3d(...)

There will be a directly interpolated rotation animation, a directly interpolated
translation animation, and finally a matrix animation for the remaining functions.
This is important for preserving transforms (such as full rotations) that are lost
during matrix decompose and recompose operations.

This change adds a new helper class SharedPrimitivesPrefix which is used to calculate
the prefix of shared primitives that are shared between keyframes.

Currently, the Core Animation backend only supports animation transformation primitives
across the entire animation, so shared primitive prefixes must span the entire animation
if an animation is accelerated. In the case that an animation is rendered in software,
this prefix can simply be between the current next and previous keyframes.

TransformOperations::blend is extended to blend any two TransformationOperations, which
makes it the only blend function necessary for software animations, computed CSS values,
and for the Nicosia backend, simplifying the interpolation code path.

  • animation/CSSPropertyAnimation.cpp:

(WebCore::blendFunc):

  • animation/CSSPropertyBlendingClient.h:
  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists):
(WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):

  • animation/KeyframeEffect.h:
  • platform/graphics/GraphicsLayer.cpp:

(WebCore::operationsAt): Deleted.
(WebCore::GraphicsLayer::getSharedPrimitivesForTransformKeyframes): Deleted.

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

(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):

  • platform/graphics/ca/GraphicsLayerCA.h:
  • platform/graphics/nicosia/NicosiaAnimation.cpp:

(Nicosia::applyTransformAnimation):
(Nicosia::Animation::Animation):
(Nicosia::Animation::operator=):
(Nicosia::Animation::applyInternal):

  • platform/graphics/nicosia/NicosiaAnimation.h:
  • platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:

(WebCore::GraphicsLayerTextureMapper::addAnimation):

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

(WebCore::CoordinatedGraphicsLayer::addAnimation):

  • platform/graphics/transforms/TransformOperations.cpp:

(WebCore::SharedPrimitivesPrefix::update):
(WebCore::TransformOperations::blend const):
(WebCore::TransformOperations::createBlendedMatrixOperationFromOperationsSuffix const):
(WebCore::TransformOperations::operationsMatch const): Deleted.
(WebCore::TransformOperations::updateSharedPrimitives const): Deleted.
(WebCore::TransformOperations::blendByMatchingOperations const): Deleted.
(WebCore::TransformOperations::blendByUsingMatrixInterpolation const): Deleted.

  • platform/graphics/transforms/TransformOperations.h:

(WebCore::TransformOperations::apply const):
(WebCore::SharedPrimitivesPrefix::hadIncompatibleTransformFunctions):
(WebCore::SharedPrimitivesPrefix::primitives):

Location:
trunk
Files:
19 edited

Legend:

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

    r290662 r290667  
     12022-03-01  Martin Robinson  <mrobinson@webkit.org>
     2
     3        When interpolating between transform lists partial prefix matches should not use matrix interpolation
     4        https://bugs.webkit.org/show_bug.cgi?id=235757
     5        <rdar://problem/88477922>
     6
     7        Reviewed by Dean Jackson.
     8
     9        * web-platform-tests/css/css-transforms/animation/list-interpolation-expected.txt: Mark subtests as passing.
     10        * web-platform-tests/css/css-transforms/animation/transform-composition-expected.txt: Ditto.
     11        * web-platform-tests/css/css-transforms/animation/transform-interpolation-004-expected.txt: Ditto.
     12
    1132022-03-01  Antoine Quint  <graouts@webkit.org>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/list-interpolation-expected.txt

    r289732 r290667  
    4444PASS 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)]
    4545PASS 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)]
    46 FAIL 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 ) "
    47 FAIL 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 ) "
    48 FAIL CSS Animations: 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 ) "
    49 FAIL Web Animations: 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 ) "
     46PASS 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)]
     47PASS 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)]
     48PASS CSS Animations: 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)]
     49PASS Web Animations: 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)]
    5050PASS CSS Transitions: property <transform> from [scale(2) rotate(0deg) translate(100px)] to [rotate(720deg) scale(2) translate(200px)] at (0.25) should be [matrix(2, 0, 0, 2, 250, 0)]
    5151PASS CSS Transitions with transition: all: property <transform> from [scale(2) rotate(0deg) translate(100px)] to [rotate(720deg) scale(2) translate(200px)] at (0.25) should be [matrix(2, 0, 0, 2, 250, 0)]
    … …  
    5656PASS CSS Animations: property <transform> from [scale(2) rotate(0deg)] to [rotate(720deg) scale(2) translate(200px)] at (0.25) should be [matrix(2, 0, 0, 2, 100, 0)]
    5757PASS Web Animations: property <transform> from [scale(2) rotate(0deg)] to [rotate(720deg) scale(2) translate(200px)] at (0.25) should be [matrix(2, 0, 0, 2, 100, 0)]
    58 FAIL CSS Transitions: property <transform> from [rotate(0deg) scaleX(1)] to [rotate(720deg) translateX(0px) scaleX(2)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( - 1.25 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 1.25 , 0 , 0 , 1 , 0 , 0 ) "
    59 FAIL CSS Transitions with transition: all: property <transform> from [rotate(0deg) scaleX(1)] to [rotate(720deg) translateX(0px) scaleX(2)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( - 1.25 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 1.25 , 0 , 0 , 1 , 0 , 0 ) "
    60 FAIL CSS Animations: property <transform> from [rotate(0deg) scaleX(1)] to [rotate(720deg) translateX(0px) scaleX(2)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( - 1.25 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 1.25 , 0 , 0 , 1 , 0 , 0 ) "
    61 FAIL Web Animations: property <transform> from [rotate(0deg) scaleX(1)] to [rotate(720deg) translateX(0px) scaleX(2)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( - 1.25 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 1.25 , 0 , 0 , 1 , 0 , 0 ) "
    62 FAIL CSS Transitions: property <transform> from [rotate(720deg) translateX(0px) scaleX(2)] to [rotate(0deg) scaleX(1)] at (0.25) should be [rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( - 1.75 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 1.75 , 0 , 0 , 1 , 0 , 0 ) "
    63 FAIL CSS Transitions with transition: all: property <transform> from [rotate(720deg) translateX(0px) scaleX(2)] to [rotate(0deg) scaleX(1)] at (0.25) should be [rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( - 1.75 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 1.75 , 0 , 0 , 1 , 0 , 0 ) "
    64 FAIL CSS Animations: property <transform> from [rotate(720deg) translateX(0px) scaleX(2)] to [rotate(0deg) scaleX(1)] at (0.25) should be [rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( - 1.75 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 1.75 , 0 , 0 , 1 , 0 , 0 ) "
    65 FAIL Web Animations: property <transform> from [rotate(720deg) translateX(0px) scaleX(2)] to [rotate(0deg) scaleX(1)] at (0.25) should be [rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)] assert_equals: expected "matrix ( - 1.75 , 0 , 0 , - 1 , 0 , 0 ) " but got "matrix ( 1.75 , 0 , 0 , 1 , 0 , 0 ) "
    66 FAIL CSS Transitions: property <transform> from [scaleX(-3) scaleY(2)] to [scaleY(-3) translateX(0px) scaleX(2)] at (0.25) should be [scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)] assert_equals: expected "matrix ( - 2.5 , 0 , 0 , 0 , 0 , 0 ) " but got "matrix ( - 1.94 , - 1.94 , - 1.59 , 1.59 , 0 , 0 ) "
    67 FAIL CSS Transitions with transition: all: property <transform> from [scaleX(-3) scaleY(2)] to [scaleY(-3) translateX(0px) scaleX(2)] at (0.25) should be [scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)] assert_equals: expected "matrix ( - 2.5 , 0 , 0 , 0 , 0 , 0 ) " but got "matrix ( - 1.94 , - 1.94 , - 1.59 , 1.59 , 0 , 0 ) "
    68 FAIL CSS Animations: property <transform> from [scaleX(-3) scaleY(2)] to [scaleY(-3) translateX(0px) scaleX(2)] at (0.25) should be [scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)] assert_equals: expected "matrix ( - 2.5 , 0 , 0 , 0 , 0 , 0 ) " but got "matrix ( - 1.94 , - 1.94 , - 1.59 , 1.59 , 0 , 0 ) "
    69 FAIL Web Animations: property <transform> from [scaleX(-3) scaleY(2)] to [scaleY(-3) translateX(0px) scaleX(2)] at (0.25) should be [scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)] assert_equals: expected "matrix ( - 2.5 , 0 , 0 , 0 , 0 , 0 ) " but got "matrix ( - 1.94 , - 1.94 , - 1.59 , 1.59 , 0 , 0 ) "
    70 FAIL CSS Transitions: property <transform> from [scaleY(-3) translateX(0px) scaleX(2)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)] assert_equals: expected "matrix ( 0 , 0 , 0 , - 2.5 , 0 , 0 ) " but got "matrix ( 1.59 , 1.59 , 1.94 , - 1.94 , 0 , 0 ) "
    71 FAIL CSS Transitions with transition: all: property <transform> from [scaleY(-3) translateX(0px) scaleX(2)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)] assert_equals: expected "matrix ( 0 , 0 , 0 , - 2.5 , 0 , 0 ) " but got "matrix ( 1.59 , 1.59 , 1.94 , - 1.94 , 0 , 0 ) "
    72 FAIL CSS Animations: property <transform> from [scaleY(-3) translateX(0px) scaleX(2)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)] assert_equals: expected "matrix ( 0 , 0 , 0 , - 2.5 , 0 , 0 ) " but got "matrix ( 1.59 , 1.59 , 1.94 , - 1.94 , 0 , 0 ) "
    73 FAIL Web Animations: property <transform> from [scaleY(-3) translateX(0px) scaleX(2)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)] assert_equals: expected "matrix ( 0 , 0 , 0 , - 2.5 , 0 , 0 ) " but got "matrix ( 1.59 , 1.59 , 1.94 , - 1.94 , 0 , 0 ) "
    74 FAIL CSS Transitions: property <transform> from [scaleY(-3) translateX(0px)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)] assert_equals: expected "matrix ( 0 , 0 , 0 , - 2.5 , 0 , 0 ) " but got "matrix ( 1.06 , 1.06 , 1.94 , - 1.94 , 0 , 0 ) "
    75 FAIL CSS Transitions with transition: all: property <transform> from [scaleY(-3) translateX(0px)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)] assert_equals: expected "matrix ( 0 , 0 , 0 , - 2.5 , 0 , 0 ) " but got "matrix ( 1.06 , 1.06 , 1.94 , - 1.94 , 0 , 0 ) "
    76 FAIL CSS Animations: property <transform> from [scaleY(-3) translateX(0px)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)] assert_equals: expected "matrix ( 0 , 0 , 0 , - 2.5 , 0 , 0 ) " but got "matrix ( 1.06 , 1.06 , 1.94 , - 1.94 , 0 , 0 ) "
    77 FAIL Web Animations: property <transform> from [scaleY(-3) translateX(0px)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)] assert_equals: expected "matrix ( 0 , 0 , 0 , - 2.5 , 0 , 0 ) " but got "matrix ( 1.06 , 1.06 , 1.94 , - 1.94 , 0 , 0 ) "
     58PASS CSS Transitions: property <transform> from [rotate(0deg) scaleX(1)] to [rotate(720deg) translateX(0px) scaleX(2)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)]
     59PASS CSS Transitions with transition: all: property <transform> from [rotate(0deg) scaleX(1)] to [rotate(720deg) translateX(0px) scaleX(2)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)]
     60PASS CSS Animations: property <transform> from [rotate(0deg) scaleX(1)] to [rotate(720deg) translateX(0px) scaleX(2)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)]
     61PASS Web Animations: property <transform> from [rotate(0deg) scaleX(1)] to [rotate(720deg) translateX(0px) scaleX(2)] at (0.25) should be [rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)]
     62PASS CSS Transitions: property <transform> from [rotate(720deg) translateX(0px) scaleX(2)] to [rotate(0deg) scaleX(1)] at (0.25) should be [rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)]
     63PASS CSS Transitions with transition: all: property <transform> from [rotate(720deg) translateX(0px) scaleX(2)] to [rotate(0deg) scaleX(1)] at (0.25) should be [rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)]
     64PASS CSS Animations: property <transform> from [rotate(720deg) translateX(0px) scaleX(2)] to [rotate(0deg) scaleX(1)] at (0.25) should be [rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)]
     65PASS Web Animations: property <transform> from [rotate(720deg) translateX(0px) scaleX(2)] to [rotate(0deg) scaleX(1)] at (0.25) should be [rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)]
     66PASS CSS Transitions: property <transform> from [scaleX(-3) scaleY(2)] to [scaleY(-3) translateX(0px) scaleX(2)] at (0.25) should be [scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)]
     67PASS CSS Transitions with transition: all: property <transform> from [scaleX(-3) scaleY(2)] to [scaleY(-3) translateX(0px) scaleX(2)] at (0.25) should be [scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)]
     68PASS CSS Animations: property <transform> from [scaleX(-3) scaleY(2)] to [scaleY(-3) translateX(0px) scaleX(2)] at (0.25) should be [scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)]
     69PASS Web Animations: property <transform> from [scaleX(-3) scaleY(2)] to [scaleY(-3) translateX(0px) scaleX(2)] at (0.25) should be [scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)]
     70PASS CSS Transitions: property <transform> from [scaleY(-3) translateX(0px) scaleX(2)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)]
     71PASS CSS Transitions with transition: all: property <transform> from [scaleY(-3) translateX(0px) scaleX(2)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)]
     72PASS CSS Animations: property <transform> from [scaleY(-3) translateX(0px) scaleX(2)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)]
     73PASS Web Animations: property <transform> from [scaleY(-3) translateX(0px) scaleX(2)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)]
     74PASS CSS Transitions: property <transform> from [scaleY(-3) translateX(0px)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)]
     75PASS CSS Transitions with transition: all: property <transform> from [scaleY(-3) translateX(0px)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)]
     76PASS CSS Animations: property <transform> from [scaleY(-3) translateX(0px)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)]
     77PASS Web Animations: property <transform> from [scaleY(-3) translateX(0px)] to [scaleX(-3) scaleY(2)] at (0.25) should be [scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)]
    7878
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-composition-expected.txt

    r285631 r290667  
    11
    2 FAIL Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (-0.5) should be [rotateX(50deg) rotateY(50deg) translate(-40px, -80px)] assert_equals: expected "matrix3d ( 0.64 , 0.59 , - 0.49 , 0 , 0 , 0.64 , 0.77 , 0 , 0.77 , - 0.49 , 0.41 , 0 , - 25.71 , - 74.9 , - 41.59 , 1 ) " but got "matrix3d ( 0.18 , 0.86 , - 0.47 , 0 , 0.76 , 0.18 , 0.63 , 0 , 0.63 , - 0.47 , - 0.62 , 0 , 49.08 , 106.27 , 87.41 , 1 ) "
     2PASS Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (-0.5) should be [rotateX(50deg) rotateY(50deg) translate(-40px, -80px)]
    33PASS Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (0) should be [rotateX(100deg) rotateY(100deg) translate(10px, 20px)]
    4 FAIL Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (0.25) should be [rotateX(125deg) rotateY(125deg) translate(35px, 70px)] assert_equals: expected "matrix3d ( - 0.57 , 0.67 , 0.47 , 0 , 0 , - 0.57 , 0.82 , 0 , 0.82 , 0.47 , 0.33 , 0 , - 20.08 , - 16.66 , 73.79 , 1 ) " but got "matrix3d ( - 0.5 , 0.81 , 0.31 , 0 , - 0.3 , - 0.5 , 0.81 , 0 , 0.81 , 0.31 , 0.49 , 0 , - 27.14 , - 43.8 , - 11.59 , 1 ) "
    5 FAIL Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (0.5) should be [rotateX(150deg) rotateY(150deg) translate(60px, 120px)] assert_equals: expected "matrix3d ( - 0.87 , 0.25 , 0.43 , 0 , 0 , - 0.87 , 0.5 , 0 , 0.5 , 0.43 , 0.75 , 0 , - 51.96 , - 88.92 , 85.98 , 1 ) " but got "matrix3d ( - 0.79 , 0.56 , 0.25 , 0 , - 0.42 , - 0.79 , 0.45 , 0 , 0.45 , 0.25 , 0.85 , 0 , - 52.55 , - 93.82 , - 44.6 , 1 ) "
    6 FAIL Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (0.75) should be [rotateX(175deg) rotateY(175deg) translate(85px, 170px)] assert_equals: expected "matrix3d ( - 1 , 0.01 , 0.09 , 0 , 0 , - 1 , 0.09 , 0 , 0.09 , 0.09 , 0.99 , 0 , - 84.68 , - 168.71 , 22.2 , 1 ) " but got "matrix3d ( - 0.95 , 0.3 , 0.02 , 0 , - 0.3 , - 0.95 , 0.02 , 0 , 0.02 , 0.02 , 1 , 0 , - 77.96 , - 143.84 , - 77.6 , 1 ) "
     4PASS Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (0.25) should be [rotateX(125deg) rotateY(125deg) translate(35px, 70px)]
     5PASS Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (0.5) should be [rotateX(150deg) rotateY(150deg) translate(60px, 120px)]
     6PASS Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (0.75) should be [rotateX(175deg) rotateY(175deg) translate(85px, 170px)]
    77PASS Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (1) should be [rotateX(200deg) rotateY(200deg) translate(110px, 220px)]
    8 FAIL Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (1.5) should be [rotateX(250deg) rotateY(250deg) translate(160px, 320px)] assert_equals: expected "matrix3d ( - 0.34 , 0.88 , - 0.32 , 0 , 0 , - 0.34 , - 0.94 , 0 , - 0.94 , - 0.32 , 0.12 , 0 , - 54.72 , 31.84 , - 352.12 , 1 ) " but got "matrix3d ( - 0.45 , 0.16 , - 0.88 , 0 , 0.76 , - 0.45 , - 0.47 , 0 , - 0.47 , - 0.88 , 0.08 , 0 , - 154.18 , - 293.91 , - 176.6 , 1 ) "
     8PASS Compositing: property <transform> underlying [rotateX(100deg) rotateY(100deg)] from add [translate(10px, 20px)] to replace [rotateX(200deg) rotateY(200deg) translate(110px, 220px)] at (1.5) should be [rotateX(250deg) rotateY(250deg) translate(160px, 320px)]
    99PASS Compositing: property <transform> underlying [rotateX(45deg)] from add [none] to add [rotateY(360deg)] at (-0.5) should be [rotateX(45deg) rotateY(-180deg)]
    1010PASS Compositing: property <transform> underlying [rotateX(45deg)] from add [none] to add [rotateY(360deg)] at (0) should be [rotateX(45deg) rotateY(0deg)]
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transforms/animation/transform-interpolation-004-expected.txt

    r267650 r290667  
    216216PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [scaleY(2) skewX(2rad) perspective(500px)] at (1) should be [matrix3d(1, 0, 0, 0, -2.185039863261519, 2, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)]
    217217PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [scaleY(2) skewX(2rad) perspective(500px)] at (2) should be [matrix3d(1, 0, 0, 0, -11.227342763749263, 3, 0, 0, 0.021237113402061854, -0.010618556701030927, 1.03, -0.0014653608247422677, -8, 4, -12, 0.9861443298969074)]
    218 FAIL CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (-1) should be [translate3d(12px, 4px, 16px) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.003, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.04 , - 0.01 , 0.95 , 0 , 12 , 4 , 16 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.03 , 0 , 0.96 , 0 , 12 , 4 , 16 , 1 ) "
     218PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (-1) should be [translate3d(12px, 4px, 16px) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.003, 0, 0, 0, 1)]
    219219PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0) should be [translate3d(8px, -4px, 12px) matrix3d(1, 0, 0, 0, 1.55741, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)]
    220220PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0.25) should be [translate3d(7px, -6px, 11px) matrix3d(1, 0, 0, 0, 1.46007, 1.25, 0, 0, 0, 0, 1, -0.002375, 0, 0, 0, 1)]
    221221PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0.75) should be [translate3d(5px, -10px, 9px) matrix3d(1, 0, 0, 0, 0.681366, 1.75, 0, 0, 0, 0, 1, -0.002125, 0, 0, 0, 1)]
    222222PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (1) should be [translate3d(4px, -12px, 8px) matrix3d(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)]
    223 FAIL CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (2) should be [translate3d(0px, -20px, 4px) matrix3d(1, 0, 0, 0, -4.67222, 3, 0, 0, 0, 0, 1, -0.0015, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 4.67 , 3 , 0 , 0 , 0 , 0.03 , 0.99 , 0 , 0 , - 20 , 4 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 4.67 , 3 , 0 , 0 , 0 , 0.04 , 1 , 0 , 0 , - 20 , 4 , 1 ) "
    224 FAIL CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (-1) should be [translate3d(12px, 4px, 16px) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.003, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.04 , - 0.01 , 0.95 , 0 , 12 , 4 , 16 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.03 , 0 , 0.96 , 0 , 12 , 4 , 16 , 1 ) "
     223PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (2) should be [translate3d(0px, -20px, 4px) matrix3d(1, 0, 0, 0, -4.67222, 3, 0, 0, 0, 0, 1, -0.0015, 0, 0, 0, 1)]
     224PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (-1) should be [translate3d(12px, 4px, 16px) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.003, 0, 0, 0, 1)]
    225225PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0) should be [translate3d(8px, -4px, 12px) matrix3d(1, 0, 0, 0, 1.55741, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)]
    226226PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0.25) should be [translate3d(7px, -6px, 11px) matrix3d(1, 0, 0, 0, 1.46007, 1.25, 0, 0, 0, 0, 1, -0.002375, 0, 0, 0, 1)]
    227227PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0.75) should be [translate3d(5px, -10px, 9px) matrix3d(1, 0, 0, 0, 0.681366, 1.75, 0, 0, 0, 0, 1, -0.002125, 0, 0, 0, 1)]
    228228PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (1) should be [translate3d(4px, -12px, 8px) matrix3d(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)]
    229 FAIL CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (2) should be [translate3d(0px, -20px, 4px) matrix3d(1, 0, 0, 0, -4.67222, 3, 0, 0, 0, 0, 1, -0.0015, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 4.67 , 3 , 0 , 0 , 0 , 0.03 , 0.99 , 0 , 0 , - 20 , 4 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 4.67 , 3 , 0 , 0 , 0 , 0.04 , 1 , 0 , 0 , - 20 , 4 , 1 ) "
    230 FAIL CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (-1) should be [translate3d(12px, 4px, 16px) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.003, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.04 , - 0.01 , 0.95 , 0 , 12 , 4 , 16 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.03 , 0 , 0.96 , 0 , 12 , 4 , 16 , 1 ) "
     229PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (2) should be [translate3d(0px, -20px, 4px) matrix3d(1, 0, 0, 0, -4.67222, 3, 0, 0, 0, 0, 1, -0.0015, 0, 0, 0, 1)]
     230PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (-1) should be [translate3d(12px, 4px, 16px) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.003, 0, 0, 0, 1)]
    231231PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0) should be [translate3d(8px, -4px, 12px) matrix3d(1, 0, 0, 0, 1.55741, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)]
    232232PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0.25) should be [translate3d(7px, -6px, 11px) matrix3d(1, 0, 0, 0, 1.46007, 1.25, 0, 0, 0, 0, 1, -0.002375, 0, 0, 0, 1)]
    233233PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0.75) should be [translate3d(5px, -10px, 9px) matrix3d(1, 0, 0, 0, 0.681366, 1.75, 0, 0, 0, 0, 1, -0.002125, 0, 0, 0, 1)]
    234234PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (1) should be [translate3d(4px, -12px, 8px) matrix3d(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)]
    235 FAIL CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (2) should be [translate3d(0px, -20px, 4px) matrix3d(1, 0, 0, 0, -4.67222, 3, 0, 0, 0, 0, 1, -0.0015, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 4.67 , 3 , 0 , 0 , 0 , 0.03 , 0.99 , 0 , 0 , - 20 , 4 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 4.67 , 3 , 0 , 0 , 0 , 0.04 , 1 , 0 , 0 , - 20 , 4 , 1 ) "
    236 FAIL Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (-1) should be [translate3d(12px, 4px, 16px) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.003, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.04 , - 0.01 , 0.95 , 0 , 12 , 4 , 16 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.03 , 0 , 0.96 , 0 , 12 , 4 , 16 , 1 ) "
     235PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (2) should be [translate3d(0px, -20px, 4px) matrix3d(1, 0, 0, 0, -4.67222, 3, 0, 0, 0, 0, 1, -0.0015, 0, 0, 0, 1)]
     236PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (-1) should be [translate3d(12px, 4px, 16px) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.003, 0, 0, 0, 1)]
    237237PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0) should be [translate3d(8px, -4px, 12px) matrix3d(1, 0, 0, 0, 1.55741, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)]
    238238PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0.25) should be [translate3d(7px, -6px, 11px) matrix3d(1, 0, 0, 0, 1.46007, 1.25, 0, 0, 0, 0, 1, -0.002375, 0, 0, 0, 1)]
    239239PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (0.75) should be [translate3d(5px, -10px, 9px) matrix3d(1, 0, 0, 0, 0.681366, 1.75, 0, 0, 0, 0, 1, -0.002125, 0, 0, 0, 1)]
    240240PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (1) should be [translate3d(4px, -12px, 8px) matrix3d(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, -0.002, 0, 0, 0, 1)]
    241 FAIL Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (2) should be [translate3d(0px, -20px, 4px) matrix3d(1, 0, 0, 0, -4.67222, 3, 0, 0, 0, 0, 1, -0.0015, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 4.67 , 3 , 0 , 0 , 0 , 0.03 , 0.99 , 0 , 0 , - 20 , 4 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 4.67 , 3 , 0 , 0 , 0 , 0.04 , 1 , 0 , 0 , - 20 , 4 , 1 ) "
    242 FAIL CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (-1) should be [translate3d(12px, 4px, 16px) skewX(0rad) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.005, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.06 , - 0.02 , 0.92 , - 0.01 , 12 , 4 , 16 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.04 , 0.02 , 0.94 , 0 , 12 , 4 , 16 , 0.98 ) "
     241PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) scaleY(2) perspective(500px)] at (2) should be [translate3d(0px, -20px, 4px) matrix3d(1, 0, 0, 0, -4.67222, 3, 0, 0, 0, 0, 1, -0.0015, 0, 0, 0, 1)]
     242PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (-1) should be [translate3d(12px, 4px, 16px) skewX(0rad) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.005, 0, 0, 0, 1)]
    243243PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0) should be [translate3d(8px, -4px, 12px) skewX(1rad) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)]
    244 FAIL CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.25) should be [translate3d(7px, -6px, 11px) skewX(1.25rad) matrix3d(1, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 1, -0.001875, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 3.76 , 1.25 , 0 , 0 , - 0.01 , 0.01 , 0.98 , 0 , 7 , - 6 , 11 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0.78 , 1.25 , 0 , 0 , - 0.02 , 0.01 , 0.98 , 0 , 7 , - 6 , 11 , 1 ) "
    245 FAIL CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.75) should be [translate3d(5px, -10px, 9px) skewX(1.75rad) matrix3d(1, 0, 0, 0, 0, 1.75, 0, 0, 0, 0, 1, -0.000625, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 9.66 , 1.75 , 0 , 0 , 0 , 0.01 , 0.99 , 0 , 5 , - 10 , 9 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 2.19 , 1.75 , 0 , 0 , - 0.01 , 0 , 0.99 , 0 , 5 , - 10 , 9 , 1 ) "
     244PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.25) should be [translate3d(7px, -6px, 11px) skewX(1.25rad) matrix3d(1, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 1, -0.001875, 0, 0, 0, 1)]
     245PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.75) should be [translate3d(5px, -10px, 9px) skewX(1.75rad) matrix3d(1, 0, 0, 0, 0, 1.75, 0, 0, 0, 0, 1, -0.000625, 0, 0, 0, 1)]
    246246PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (1) should be [translate3d(4px, -12px, 8px) skewX(2rad) matrix(1, 0, 0, 2, 0, 0)]
    247 FAIL CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (2) should be [translate3d(0px, -20px, 4px) skewX(3rad) matrix3d(1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0.0025, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 0.43 , 3 , 0 , 0 , 0 , - 0.05 , 1.01 , 0 , 0 , - 20 , 4 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 17.78 , 3 , 0 , 0 , 0.02 , - 0.01 , 1.03 , 0 , 0 , - 20 , 4 , 0.98 ) "
    248 FAIL CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (-1) should be [translate3d(12px, 4px, 16px) skewX(0rad) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.005, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.06 , - 0.02 , 0.92 , - 0.01 , 12 , 4 , 16 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.04 , 0.02 , 0.94 , 0 , 12 , 4 , 16 , 0.98 ) "
     247PASS CSS Transitions: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (2) should be [translate3d(0px, -20px, 4px) skewX(3rad) matrix3d(1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0.0025, 0, 0, 0, 1)]
     248PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (-1) should be [translate3d(12px, 4px, 16px) skewX(0rad) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.005, 0, 0, 0, 1)]
    249249PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0) should be [translate3d(8px, -4px, 12px) skewX(1rad) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)]
    250 FAIL CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.25) should be [translate3d(7px, -6px, 11px) skewX(1.25rad) matrix3d(1, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 1, -0.001875, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 3.76 , 1.25 , 0 , 0 , - 0.01 , 0.01 , 0.98 , 0 , 7 , - 6 , 11 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0.78 , 1.25 , 0 , 0 , - 0.02 , 0.01 , 0.98 , 0 , 7 , - 6 , 11 , 1 ) "
    251 FAIL CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.75) should be [translate3d(5px, -10px, 9px) skewX(1.75rad) matrix3d(1, 0, 0, 0, 0, 1.75, 0, 0, 0, 0, 1, -0.000625, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 9.66 , 1.75 , 0 , 0 , 0 , 0.01 , 0.99 , 0 , 5 , - 10 , 9 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 2.19 , 1.75 , 0 , 0 , - 0.01 , 0 , 0.99 , 0 , 5 , - 10 , 9 , 1 ) "
     250PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.25) should be [translate3d(7px, -6px, 11px) skewX(1.25rad) matrix3d(1, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 1, -0.001875, 0, 0, 0, 1)]
     251PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.75) should be [translate3d(5px, -10px, 9px) skewX(1.75rad) matrix3d(1, 0, 0, 0, 0, 1.75, 0, 0, 0, 0, 1, -0.000625, 0, 0, 0, 1)]
    252252PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (1) should be [translate3d(4px, -12px, 8px) skewX(2rad) matrix(1, 0, 0, 2, 0, 0)]
    253 FAIL CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (2) should be [translate3d(0px, -20px, 4px) skewX(3rad) matrix3d(1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0.0025, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 0.43 , 3 , 0 , 0 , 0 , - 0.05 , 1.01 , 0 , 0 , - 20 , 4 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 17.78 , 3 , 0 , 0 , 0.02 , - 0.01 , 1.03 , 0 , 0 , - 20 , 4 , 0.98 ) "
    254 FAIL CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (-1) should be [translate3d(12px, 4px, 16px) skewX(0rad) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.005, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.06 , - 0.02 , 0.92 , - 0.01 , 12 , 4 , 16 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.04 , 0.02 , 0.94 , 0 , 12 , 4 , 16 , 0.98 ) "
     253PASS CSS Transitions with transition: all: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (2) should be [translate3d(0px, -20px, 4px) skewX(3rad) matrix3d(1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0.0025, 0, 0, 0, 1)]
     254PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (-1) should be [translate3d(12px, 4px, 16px) skewX(0rad) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.005, 0, 0, 0, 1)]
    255255PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0) should be [translate3d(8px, -4px, 12px) skewX(1rad) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)]
    256 FAIL CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.25) should be [translate3d(7px, -6px, 11px) skewX(1.25rad) matrix3d(1, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 1, -0.001875, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 3.76 , 1.25 , 0 , 0 , - 0.01 , 0.01 , 0.98 , 0 , 7 , - 6 , 11 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0.78 , 1.25 , 0 , 0 , - 0.02 , 0.01 , 0.98 , 0 , 7 , - 6 , 11 , 1 ) "
    257 FAIL CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.75) should be [translate3d(5px, -10px, 9px) skewX(1.75rad) matrix3d(1, 0, 0, 0, 0, 1.75, 0, 0, 0, 0, 1, -0.000625, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 9.66 , 1.75 , 0 , 0 , 0 , 0.01 , 0.99 , 0 , 5 , - 10 , 9 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 2.19 , 1.75 , 0 , 0 , - 0.01 , 0 , 0.99 , 0 , 5 , - 10 , 9 , 1 ) "
     256PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.25) should be [translate3d(7px, -6px, 11px) skewX(1.25rad) matrix3d(1, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 1, -0.001875, 0, 0, 0, 1)]
     257PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.75) should be [translate3d(5px, -10px, 9px) skewX(1.75rad) matrix3d(1, 0, 0, 0, 0, 1.75, 0, 0, 0, 0, 1, -0.000625, 0, 0, 0, 1)]
    258258PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (1) should be [translate3d(4px, -12px, 8px) skewX(2rad) matrix(1, 0, 0, 2, 0, 0)]
    259 FAIL CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (2) should be [translate3d(0px, -20px, 4px) skewX(3rad) matrix3d(1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0.0025, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 0.43 , 3 , 0 , 0 , 0 , - 0.05 , 1.01 , 0 , 0 , - 20 , 4 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 17.78 , 3 , 0 , 0 , 0.02 , - 0.01 , 1.03 , 0 , 0 , - 20 , 4 , 0.98 ) "
    260 FAIL Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (-1) should be [translate3d(12px, 4px, 16px) skewX(0rad) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.005, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.06 , - 0.02 , 0.92 , - 0.01 , 12 , 4 , 16 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0.04 , 0.02 , 0.94 , 0 , 12 , 4 , 16 , 0.98 ) "
     259PASS CSS Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (2) should be [translate3d(0px, -20px, 4px) skewX(3rad) matrix3d(1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0.0025, 0, 0, 0, 1)]
     260PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (-1) should be [translate3d(12px, 4px, 16px) skewX(0rad) matrix3d(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -0.005, 0, 0, 0, 1)]
    261261PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0) should be [translate3d(8px, -4px, 12px) skewX(1rad) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, -0.0025, 0, 0, 0, 1)]
    262 FAIL Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.25) should be [translate3d(7px, -6px, 11px) skewX(1.25rad) matrix3d(1, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 1, -0.001875, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , 3.76 , 1.25 , 0 , 0 , - 0.01 , 0.01 , 0.98 , 0 , 7 , - 6 , 11 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , 0.78 , 1.25 , 0 , 0 , - 0.02 , 0.01 , 0.98 , 0 , 7 , - 6 , 11 , 1 ) "
    263 FAIL Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.75) should be [translate3d(5px, -10px, 9px) skewX(1.75rad) matrix3d(1, 0, 0, 0, 0, 1.75, 0, 0, 0, 0, 1, -0.000625, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 9.66 , 1.75 , 0 , 0 , 0 , 0.01 , 0.99 , 0 , 5 , - 10 , 9 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 2.19 , 1.75 , 0 , 0 , - 0.01 , 0 , 0.99 , 0 , 5 , - 10 , 9 , 1 ) "
     262PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.25) should be [translate3d(7px, -6px, 11px) skewX(1.25rad) matrix3d(1, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 1, -0.001875, 0, 0, 0, 1)]
     263PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (0.75) should be [translate3d(5px, -10px, 9px) skewX(1.75rad) matrix3d(1, 0, 0, 0, 0, 1.75, 0, 0, 0, 0, 1, -0.000625, 0, 0, 0, 1)]
    264264PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (1) should be [translate3d(4px, -12px, 8px) skewX(2rad) matrix(1, 0, 0, 2, 0, 0)]
    265 FAIL Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (2) should be [translate3d(0px, -20px, 4px) skewX(3rad) matrix3d(1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0.0025, 0, 0, 0, 1)] assert_equals: expected "matrix3d ( 1 , 0 , 0 , 0 , - 0.43 , 3 , 0 , 0 , 0 , - 0.05 , 1.01 , 0 , 0 , - 20 , 4 , 1 ) " but got "matrix3d ( 1 , 0 , 0 , 0 , - 17.78 , 3 , 0 , 0 , 0.02 , - 0.01 , 1.03 , 0 , 0 , - 20 , 4 , 0.98 ) "
     265PASS Web Animations: property <transform> from [translate3d(8px, -4px, 12px) skewX(1rad) perspective(400px)] to [translate3d(4px, -12px, 8px) skewX(2rad) scaleY(2)] at (2) should be [translate3d(0px, -20px, 4px) skewX(3rad) matrix3d(1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0.0025, 0, 0, 0, 1)]
    266266PASS CSS Transitions: property <transform> from [translate3D(100px, 200px, 300px)] to [none] at (-1) should be [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 200, 400, 600, 1)]
    267267PASS CSS Transitions: property <transform> from [translate3D(100px, 200px, 300px)] to [none] at (0) should be [matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 100, 200, 300, 1)]
  • trunk/Source/WebCore/ChangeLog

    r290663 r290667  
     12022-03-01  Martin Robinson  <mrobinson@webkit.org>
     2
     3        When interpolating between transform lists partial prefix matches should not use matrix interpolation
     4        https://bugs.webkit.org/show_bug.cgi?id=235757
     5        <rdar://problem/88477922>
     6
     7        Reviewed by Dean Jackson.
     8
     9        No new tests. This is covered by existing WPT tests.
     10
     11        When interpolation between keyframes in transform animations, interpolate prefixes of
     12        compatible transform functions directly. For instance if there are three keyframes:
     13
     14        1. transform: rotateX(...) translateY(...) skew(...)
     15        2. transform: rotateY(...) translateY(...)
     16        3. transform: rotateZ(...) translateZ(...) matrix3d(...)
     17
     18        There will be a directly interpolated rotation animation, a directly interpolated
     19        translation animation, and finally a matrix animation for the remaining functions.
     20        This is important for preserving transforms (such as full rotations) that are lost
     21        during matrix decompose and recompose operations.
     22
     23        This change adds a new helper class SharedPrimitivesPrefix which is used to calculate
     24        the prefix of shared primitives that are shared between keyframes.
     25
     26        Currently, the Core Animation backend only supports animation transformation primitives
     27        across the entire animation, so shared primitive prefixes must span the entire animation
     28        if an animation is accelerated. In the case that an animation is rendered in software,
     29        this prefix can simply be between the current next and previous keyframes.
     30
     31        TransformOperations::blend is extended to blend any two TransformationOperations, which
     32        makes it the only blend function necessary for software animations, computed CSS values,
     33        and for the Nicosia backend, simplifying the interpolation code path.
     34
     35        * animation/CSSPropertyAnimation.cpp:
     36        (WebCore::blendFunc):
     37        * animation/CSSPropertyBlendingClient.h:
     38        * animation/KeyframeEffect.cpp:
     39        (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists):
     40        (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
     41        * animation/KeyframeEffect.h:
     42        * platform/graphics/GraphicsLayer.cpp:
     43        (WebCore::operationsAt): Deleted.
     44        (WebCore::GraphicsLayer::getSharedPrimitivesForTransformKeyframes): Deleted.
     45        * platform/graphics/GraphicsLayer.h:
     46        * platform/graphics/ca/GraphicsLayerCA.cpp:
     47        (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
     48        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
     49        (WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
     50        * platform/graphics/ca/GraphicsLayerCA.h:
     51        * platform/graphics/nicosia/NicosiaAnimation.cpp:
     52        (Nicosia::applyTransformAnimation):
     53        (Nicosia::Animation::Animation):
     54        (Nicosia::Animation::operator=):
     55        (Nicosia::Animation::applyInternal):
     56        * platform/graphics/nicosia/NicosiaAnimation.h:
     57        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
     58        (WebCore::GraphicsLayerTextureMapper::addAnimation):
     59        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
     60        (WebCore::CoordinatedGraphicsLayer::addAnimation):
     61        * platform/graphics/transforms/TransformOperations.cpp:
     62        (WebCore::SharedPrimitivesPrefix::update):
     63        (WebCore::TransformOperations::blend const):
     64        (WebCore::TransformOperations::createBlendedMatrixOperationFromOperationsSuffix const):
     65        (WebCore::TransformOperations::operationsMatch const): Deleted.
     66        (WebCore::TransformOperations::updateSharedPrimitives const): Deleted.
     67        (WebCore::TransformOperations::blendByMatchingOperations const): Deleted.
     68        (WebCore::TransformOperations::blendByUsingMatrixInterpolation const): Deleted.
     69        * platform/graphics/transforms/TransformOperations.h:
     70        (WebCore::TransformOperations::apply const):
     71        (WebCore::SharedPrimitivesPrefix::hadIncompatibleTransformFunctions):
     72        (WebCore::SharedPrimitivesPrefix::primitives):
     73
    1742022-03-01  Commit Queue  <commit-queue@webkit.org>
    275
  • trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp

    r290329 r290667  
    170170    }
    171171    auto boxSize = is<RenderBox>(context.client->renderer()) ? downcast<RenderBox>(*context.client->renderer()).borderBoxRect().size() : LayoutSize();
    172     if (context.client->transformFunctionListsMatch())
    173         return to.blendByMatchingOperations(from, context, boxSize);
    174     return to.blendByUsingMatrixInterpolation(from, context, boxSize);
     172    return to.blend(from, context, boxSize, context.client->transformFunctionListPrefix());
    175173}
    176174
  • trunk/Source/WebCore/animation/CSSPropertyBlendingClient.h

    r252554 r290667  
    2626#pragma once
    2727
     28#include <optional>
     29
    2830namespace WebCore {
    2931
    … …  
    3739    virtual const RenderStyle& currentStyle() const = 0;
    3840    virtual bool filterFunctionListsMatch() const = 0;
    39     virtual bool transformFunctionListsMatch() const = 0;
     41    virtual std::optional<unsigned> transformFunctionListPrefix() const = 0;
    4042#if ENABLE(FILTERS_LEVEL_2)
    4143    virtual bool backdropFilterFunctionListsMatch() const = 0;
  • trunk/Source/WebCore/animation/KeyframeEffect.cpp

    r290662 r290667  
    914914void KeyframeEffect::checkForMatchingTransformFunctionLists()
    915915{
    916     m_transformFunctionListsMatch = false;
    917 
    918     if (m_blendingKeyframes.size() < 2 || !m_blendingKeyframes.containsProperty(CSSPropertyTransform))
    919         return;
    920 
    921     Vector<TransformOperation::OperationType> sharedPrimitives;
    922     sharedPrimitives.reserveInitialCapacity(m_blendingKeyframes[0].style()->transform().operations().size());
    923 
    924     for (const auto& keyframe : m_blendingKeyframes) {
    925         if (!keyframe.style()->transform().updateSharedPrimitives(sharedPrimitives))
    926             return;
    927     }
    928 
    929     m_transformFunctionListsMatch = true;
     916    if (m_blendingKeyframes.size() < 2 || !m_blendingKeyframes.containsProperty(CSSPropertyTransform)) {
     917        m_transformFunctionListsMatchPrefix = 0;
     918        return;
     919    }
     920
     921    SharedPrimitivesPrefix prefix;
     922    for (const auto& keyframe : m_blendingKeyframes)
     923        prefix.update(keyframe.style()->transform());
     924
     925    m_transformFunctionListsMatchPrefix = prefix.primitives().size();
    930926}
    931927
    … …  
    19421938
    19431939        bool canCompute;
    1944         if (transformFunctionListsMatch())
     1940        if (transformFunctionListPrefix() > 0)
    19451941            canCompute = computeTransformedExtentViaTransformList(rendererBox, *style, keyframeBounds);
    19461942        else
  • trunk/Source/WebCore/animation/KeyframeEffect.h

    r289598 r290667  
    141141
    142142    bool filterFunctionListsMatch() const override { return m_filterFunctionListsMatch; }
    143     bool transformFunctionListsMatch() const override { return m_transformFunctionListsMatch; }
     143
     144    // The CoreAnimation animation code can only use direct function interpolation when all keyframes share the same
     145    // prefix of shared transform function primitives, whereas software animations simply calls blend(...) which can do
     146    // direct interpolation based on the function list of any two particular keyframes. The prefix serves as a way to
     147    // make sure that the results of blend(...) can be made to return the same results as rendered by the hardware
     148    // animation code.
     149    std::optional<unsigned> transformFunctionListPrefix() const override { return (!preventsAcceleration()) ? std::optional<unsigned>(m_transformFunctionListsMatchPrefix) : std::nullopt; }
     150
    144151#if ENABLE(FILTERS_LEVEL_2)
    145152    bool backdropFilterFunctionListsMatch() const override { return m_backdropFilterFunctionListsMatch; }
    … …  
    242249    bool m_needsForcedLayout { false };
    243250    bool m_triggersStackingContext { false };
    244     bool m_transformFunctionListsMatch { false };
     251    size_t m_transformFunctionListsMatchPrefix { 0 };
    245252    bool m_filterFunctionListsMatch { false };
    246253#if ENABLE(FILTERS_LEVEL_2)
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r290545 r290667  
    712712}
    713713
    714 static inline const TransformOperations& operationsAt(const KeyframeValueList& valueList, size_t index)
    715 {
    716     return static_cast<const TransformAnimationValue&>(valueList.at(index)).value();
    717 }
    718 
    719 // A sequence of keyframes with a list of transforms can be represented without matrix interpolation
    720 // if each transform is compatible with all other transforms at the same index in other keyframes.
    721 // Two transforms are compatible if they share a primitive defined by the CSS Transforms Level 2
    722 // specification. For instance, the shared primitive of a translateX and translate3D operation is
    723 // TransformOperation::TRANSLATE_3D. This function returns true if the TransformOperations in each
    724 // keyframe share a primitive operation type and stores the compatible OperationTypes in
    725 // sharedPrimitives. If the keyframes do not share a list of compatible primitives, false is
    726 // returned.
    727 bool GraphicsLayer::getSharedPrimitivesForTransformKeyframes(const KeyframeValueList& valueList, Vector<TransformOperation::OperationType>& sharedPrimitives)
    728 {
    729     ASSERT(animatedPropertyIsTransformOrRelated(valueList.property()));
    730 
    731     if (valueList.size() < 2)
    732         return false;
    733 
    734     sharedPrimitives.clear();
    735     sharedPrimitives.reserveInitialCapacity(operationsAt(valueList, 0).size());
    736 
    737     for (size_t i = 0; i < valueList.size(); ++i) {
    738         if (!operationsAt(valueList, i).updateSharedPrimitives(sharedPrimitives))
    739             return false;
    740     }
    741 
    742     return true;
    743 }
    744 
    745714double GraphicsLayer::backingStoreMemoryEstimate() const
    746715{
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r290545 r290667  
    668668    static int validateFilterOperations(const KeyframeValueList&);
    669669
    670     // Given a list of TransformAnimationValues keyframes, place a list of primitive operations which can
    671     // represent the transform functions of every keyframe in the sharedPrimitives out parameter and return
    672     // true. If the keyframes do not share compatible functions, return false.
    673     static bool getSharedPrimitivesForTransformKeyframes(const KeyframeValueList&, Vector<TransformOperation::OperationType>& sharedPrimitives);
    674 
    675670    virtual bool shouldRepaintOnSizeChange() const { return drawsContent(); }
    676671
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r290575 r290667  
    34593459}
    34603460
    3461 bool 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];
    3465 
     3461bool GraphicsLayerCA::appendToUncommittedAnimations(const KeyframeValueList& valueList, TransformOperation::OperationType operationType, const Animation* animation, const String& animationName, const FloatSize& boxSize, unsigned animationIndex, Seconds timeOffset, bool isMatrixAnimation, bool keyframesShouldUseAnimationWideTimingFunction)
     3462{
    34663463    RefPtr<PlatformCAAnimation> caAnimation;
    34673464    bool validMatrices = true;
    34683465    if (isKeyframe(valueList)) {
    34693466        caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), false, keyframesShouldUseAnimationWideTimingFunction);
    3470         validMatrices = setTransformAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize, keyframesShouldUseAnimationWideTimingFunction);
     3467        validMatrices = setTransformAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, operationType, isMatrixAnimation, boxSize, keyframesShouldUseAnimationWideTimingFunction);
    34713468    } else {
    34723469        if (animation->timingFunction()->isSpringTimingFunction())
    … …  
    34743471        else
    34753472            caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), false, keyframesShouldUseAnimationWideTimingFunction);
    3476         validMatrices = setTransformAnimationEndpoints(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize);
     3473        validMatrices = setTransformAnimationEndpoints(valueList, animation, caAnimation.get(), animationIndex, operationType, isMatrixAnimation, boxSize);
    34773474    }
    34783475   
    … …  
    34883485    ASSERT(animatedPropertyIsTransformOrRelated(valueList.property()));
    34893486
    3490     Vector<TransformOperation::OperationType> sharedPrimitives;
    3491     bool isMatrixAnimation = !getSharedPrimitivesForTransformKeyframes(valueList, sharedPrimitives);
    3492     unsigned numOperations = !isMatrixAnimation ? sharedPrimitives.size() : 1;
    3493 
    3494     bool validMatrices = true;
    3495     for (unsigned animationIndex = 0; animationIndex < numOperations; ++animationIndex) {
    3496         if (!appendToUncommittedAnimations(valueList, sharedPrimitives, animation, animationName, boxSize, animationIndex, timeOffset, isMatrixAnimation, keyframesShouldUseAnimationWideTimingFunction)) {
    3497             validMatrices = false;
    3498             break;
    3499         }
    3500     }
    3501 
    3502     return validMatrices;
     3487    // https://www.w3.org/TR/css-transforms-1/#interpolation-of-transforms
     3488    // In the CSS Transform Level 1 and 2 Specification some transform functions can share a compatible transform
     3489    // function primitive. For instance, the shared primitive of a translateX and translate3D operation is
     3490    // TransformOperation::TRANSLATE_3D. When the transform function list of every keyframe in an animation
     3491    // shares the same transform function primitive, we should interpolate between them without resorting
     3492    // to matrix decomposition. The remaining parts of the transform function list should be interpolated
     3493    // using matrix decomposition. The code below finds the shared primitives in this prefix.
     3494    // FIXME: Currently, this only supports situations where every keyframe shares the same prefix of shared
     3495    // transformation primitives, but the specification says direct interpolation should be determined by
     3496    // the primitives shared between any two adjacent keyframes.
     3497    SharedPrimitivesPrefix prefix;
     3498    for (size_t i = 0; i < valueList.size(); ++i)
     3499        prefix.update(static_cast<const TransformAnimationValue&>(valueList.at(i)).value());
     3500
     3501    const auto& primitives = prefix.primitives();
     3502    unsigned numberOfSharedPrimitives = valueList.size() > 1 ? primitives.size() : 0;
     3503    for (unsigned animationIndex = 0; animationIndex < numberOfSharedPrimitives; ++animationIndex) {
     3504        if (!appendToUncommittedAnimations(valueList, primitives[animationIndex], animation, animationName, boxSize, animationIndex, timeOffset, false /* isMatrixAnimation */, keyframesShouldUseAnimationWideTimingFunction))
     3505            return false;
     3506    }
     3507
     3508    if (!prefix.hadIncompatibleTransformFunctions())
     3509        return true;
     3510
     3511    // If there were any incompatible transform functions, they will be appended to the animation list
     3512    // as a single combined transformation matrix animation.
     3513    return appendToUncommittedAnimations(valueList, TransformOperation::MATRIX_3D, animation, animationName, boxSize, primitives.size(), timeOffset, true /* isMatrixAnimation */, keyframesShouldUseAnimationWideTimingFunction);
    35033514}
    35043515
    … …  
    37793790        keyTimes.append(forwards ? curValue.keyTime() : (1 - curValue.keyTime()));
    37803791
    3781         TransformationMatrix transform;
    3782 
    37833792        if (isMatrixAnimation) {
    3784             curValue.value().apply(boxSize, transform);
     3793            TransformationMatrix transform;
     3794            curValue.value().apply(functionIndex, boxSize, transform);
    37853795
    37863796            // If any matrix is singular, CA won't animate it correctly. So fall back to software animation
    … …  
    38043814                transformationMatrixValues.append(value);
    38053815            }
    3806 
    3807             curValue.value().apply(boxSize, transform);
    38083816        }
    38093817
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r289032 r290667  
    531531    }
    532532
    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);
     533    bool appendToUncommittedAnimations(const KeyframeValueList&, const TransformOperation::OperationType, 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/nicosia/NicosiaAnimation.cpp

    r282751 r290667  
    110110}
    111111
    112 static TransformationMatrix applyTransformAnimation(const TransformOperations& from, const TransformOperations& to, double progress, const FloatSize& boxSize, bool listsMatch)
     112static TransformationMatrix applyTransformAnimation(const TransformOperations& from, const TransformOperations& to, double progress, const FloatSize& boxSize)
    113113{
    114114    TransformationMatrix matrix;
    … …  
    126126    }
    127127
    128     // If we have incompatible operation lists, we blend the resulting matrices.
    129     if (!listsMatch) {
    130         TransformationMatrix fromMatrix;
    131         to.apply(boxSize, matrix);
    132         from.apply(boxSize, fromMatrix);
    133         matrix.blend(fromMatrix, progress);
    134         return matrix;
    135     }
    136 
    137     // Animation to "-webkit-transform: none".
    138     if (!to.size()) {
    139         TransformOperations blended(from);
    140         for (auto& operation : blended.operations())
    141             operation->blend(nullptr, progress, true)->apply(matrix, boxSize);
    142         return matrix;
    143     }
    144 
    145     // Animation from "-webkit-transform: none".
    146     if (!from.size()) {
    147         TransformOperations blended(to);
    148         for (auto& operation : blended.operations())
    149             operation->blend(nullptr, 1 - progress, true)->apply(matrix, boxSize);
    150         return matrix;
    151     }
    152 
    153     // Normal animation with a matching operation list.
    154     TransformOperations blended(to);
    155     for (size_t i = 0; i < blended.operations().size(); ++i)
    156         blended.operations()[i]->blend(from.at(i), progress, !from.at(i))->apply(matrix, boxSize);
     128    to.blend(from, progress, LayoutSize { boxSize }).apply(boxSize, matrix);
    157129    return matrix;
    158130}
    … …  
    167139}
    168140
    169 Animation::Animation(const String& name, const KeyframeValueList& keyframes, const FloatSize& boxSize, const WebCore::Animation& animation, bool listsMatch, MonotonicTime startTime, Seconds pauseTime, AnimationState state)
     141Animation::Animation(const String& name, const KeyframeValueList& keyframes, const FloatSize& boxSize, const WebCore::Animation& animation, MonotonicTime startTime, Seconds pauseTime, AnimationState state)
    170142    : m_name(name.isSafeToSendToAnotherThread() ? name : name.isolatedCopy())
    171143    , m_keyframes(keyframes)
    … …  
    176148    , m_direction(animation.direction())
    177149    , m_fillsForwards(animation.fillsForwards())
    178     , m_listsMatch(listsMatch)
    179150    , m_startTime(startTime)
    180151    , m_pauseTime(pauseTime)
    … …  
    194165    , m_direction(other.m_direction)
    195166    , m_fillsForwards(other.m_fillsForwards)
    196     , m_listsMatch(other.m_listsMatch)
    197167    , m_startTime(other.m_startTime)
    198168    , m_pauseTime(other.m_pauseTime)
    … …  
    213183    m_direction = other.m_direction;
    214184    m_fillsForwards = other.m_fillsForwards;
    215     m_listsMatch = other.m_listsMatch;
    216185    m_startTime = other.m_startTime;
    217186    m_pauseTime = other.m_pauseTime;
    … …  
    312281    switch (m_keyframes.property()) {
    313282    case AnimatedPropertyTransform:
    314         applicationResults.transform = applyTransformAnimation(static_cast<const TransformAnimationValue&>(from).value(), static_cast<const TransformAnimationValue&>(to).value(), progress, m_boxSize, m_listsMatch);
     283        applicationResults.transform = applyTransformAnimation(static_cast<const TransformAnimationValue&>(from).value(), static_cast<const TransformAnimationValue&>(to).value(), progress, m_boxSize);
    315284        return;
    316285    case AnimatedPropertyOpacity:
  • trunk/Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.h

    r278253 r290667  
    4343        : m_keyframes(WebCore::AnimatedPropertyInvalid)
    4444    { }
    45     Animation(const String&, const WebCore::KeyframeValueList&, const WebCore::FloatSize&, const WebCore::Animation&, bool, MonotonicTime, Seconds, AnimationState);
     45    Animation(const String&, const WebCore::KeyframeValueList&, const WebCore::FloatSize&, const WebCore::Animation&, MonotonicTime, Seconds, AnimationState);
    4646
    4747    WEBCORE_EXPORT Animation(const Animation&);
    … …  
    7272    WebCore::Animation::AnimationDirection m_direction;
    7373    bool m_fillsForwards;
    74     bool m_listsMatch;
    7574    MonotonicTime m_startTime;
    7675    Seconds m_pauseTime;
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp

    r289032 r290667  
    612612    }
    613613
    614     bool listsMatch = false;
    615     if (valueList.property() == AnimatedPropertyTransform) {
    616         Vector<TransformOperation::OperationType> unusedOperations;
    617         listsMatch = !!getSharedPrimitivesForTransformKeyframes(valueList, unusedOperations);
    618     }
    619 
    620614    const MonotonicTime currentTime = MonotonicTime::now();
    621     m_animations.add(Nicosia::Animation(keyframesName, valueList, boxSize, *anim, listsMatch, currentTime - Seconds(timeOffset), 0_s, Nicosia::Animation::AnimationState::Playing));
     615    m_animations.add(Nicosia::Animation(keyframesName, valueList, boxSize, *anim, currentTime - Seconds(timeOffset), 0_s, Nicosia::Animation::AnimationState::Playing));
    622616    // m_animationStartTime is the time of the first real frame of animation, now or delayed by a negative offset.
    623617    if (Seconds(timeOffset) > 0_s)
  • trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

    r290575 r290667  
    14001400        return false;
    14011401
    1402     bool listsMatch = false;
    14031402    switch (valueList.property()) {
    14041403#if ENABLE(FILTERS_LEVEL_2)
    … …  
    14151414        break;
    14161415    }
    1417     case AnimatedPropertyTransform: {
    1418         Vector<TransformOperation::OperationType> unusedOperations;
    1419         listsMatch = !!getSharedPrimitivesForTransformKeyframes(valueList, unusedOperations);
    1420         break;
    1421     }
    14221416    case AnimatedPropertyOpacity:
     1417    case AnimatedPropertyTransform:
    14231418        break;
    14241419    default:
    … …  
    14271422
    14281423    m_lastAnimationStartTime = MonotonicTime::now() - Seconds(delayAsNegativeTimeOffset);
    1429     m_animations.add(Nicosia::Animation(keyframesName, valueList, boxSize, *anim, listsMatch, m_lastAnimationStartTime, 0_s, Nicosia::Animation::AnimationState::Playing));
     1424    m_animations.add(Nicosia::Animation(keyframesName, valueList, boxSize, *anim, m_lastAnimationStartTime, 0_s, Nicosia::Animation::AnimationState::Playing));
    14301425    m_animationStartedTimer.startOneShot(0_s);
    14311426    didChangeAnimations();
  • trunk/Source/WebCore/platform/graphics/transforms/TransformOperations.cpp

    r289862 r290667  
    5151}
    5252
    53 bool TransformOperations::operationsMatch(const TransformOperations& other) const
     53void SharedPrimitivesPrefix::update(const TransformOperations& operations)
    5454{
    55     // If functions at the same index don't share a blending primitive, the lists don't match.
    56     // When the lists are different sizes, the missing functions in the shorter list are treated
    57     // as identity functions.
    58     size_t minimumLength = std::min(operations().size(), other.operations().size());
    59     for (size_t i = 0; i < minimumLength; ++i) {
    60         if (!operations()[i]->sharedPrimitiveType(other.operations()[i].get()))
    61             return false;
    62     }
    63     return true;
    64 }
     55    size_t maxIteration = operations.operations().size();
     56    if (m_indexOfFirstMismatch.has_value())
     57        maxIteration = std::min(*m_indexOfFirstMismatch, maxIteration);
    6558
    66 bool TransformOperations::updateSharedPrimitives(Vector<TransformOperation::OperationType>& sharedPrimitives) const
    67 {
    68     for (size_t i = 0; i < operations().size(); ++i) {
    69         const auto* operation = at(i);
     59    for (size_t i = 0; i < maxIteration; ++i) {
     60        const auto* operation = operations.at(i);
    7061
    7162        // If we haven't seen an operation at this index before, we can simply use our primitive type.
    72         if (i >= sharedPrimitives.size()) {
    73             ASSERT(i == sharedPrimitives.size());
    74             sharedPrimitives.append(operation->primitiveType());
     63        if (i >= m_primitives.size()) {
     64            ASSERT(i == m_primitives.size());
     65            m_primitives.append(operation->primitiveType());
    7566            continue;
    7667        }
    7768
    78         if (auto sharedPrimitive = operation->sharedPrimitiveType(sharedPrimitives[i]))
    79             sharedPrimitives[i] = *sharedPrimitive;
     69        if (auto sharedPrimitive = operation->sharedPrimitiveType(m_primitives[i]))
     70            m_primitives[i] = *sharedPrimitive;
    8071        else {
    81             // FIXME: This should handle prefix matches and then fall back to matrix interpolation for the rest
    82             // of the list. See: https://bugs.webkit.org/show_bug.cgi?id=235757
    83             return false;
     72            m_indexOfFirstMismatch = i;
     73            m_primitives.shrink(i);
     74            return;
    8475        }
    8576    }
    86 
    87     return true;
    8877}
    8978
    … …  
    10291}
    10392
    104 TransformOperations TransformOperations::blendByMatchingOperations(const TransformOperations& from, const BlendingContext& context, const LayoutSize& boxSize) const
     93TransformOperations TransformOperations::blend(const TransformOperations& from, const BlendingContext& context, const LayoutSize& boxSize, std::optional<unsigned> prefixLength) const
    10594{
    10695    TransformOperations result;
    … …  
    10998    unsigned toOperationCount = operations().size();
    11099    unsigned maxOperationCount = std::max(fromOperationCount, toOperationCount);
    111    
    112     if (shouldFallBackToDiscreteAnimation(from, boxSize))
    113         return blendByUsingMatrixInterpolation(from, context, boxSize);
    114    
     100
     101    if (shouldFallBackToDiscreteAnimation(from, boxSize)) {
     102        result.operations().append(createBlendedMatrixOperationFromOperationsSuffix(from, 0, context, boxSize));
     103        return result;
     104    }
     105
    115106    for (unsigned i = 0; i < maxOperationCount; i++) {
    116107        RefPtr<TransformOperation> fromOperation = (i < fromOperationCount) ? from.operations()[i].get() : nullptr;
    117108        RefPtr<TransformOperation> toOperation = (i < toOperationCount) ? operations()[i].get() : nullptr;
    118         if (fromOperation && toOperation && !fromOperation->sharedPrimitiveType(toOperation.get()))
    119             return blendByUsingMatrixInterpolation(from, context, boxSize);
     109        if ((prefixLength && i >= *prefixLength) || (fromOperation && toOperation && !fromOperation->sharedPrimitiveType(toOperation.get()))) {
     110            result.operations().append(createBlendedMatrixOperationFromOperationsSuffix(from, i, context, boxSize));
     111            return result;
     112        }
    120113
    121114        RefPtr<TransformOperation> blendedOperation;
    … …  
    136129}
    137130
    138 TransformOperations TransformOperations::blendByUsingMatrixInterpolation(const TransformOperations& from, const BlendingContext& context, const LayoutSize& boxSize) const
     131RefPtr<TransformOperation> TransformOperations::createBlendedMatrixOperationFromOperationsSuffix(const TransformOperations& from, unsigned start, const BlendingContext& context, const LayoutSize& referenceBoxSize) const
    139132{
    140     TransformOperations result;
     133    TransformationMatrix fromTransform;
     134    from.apply(start, referenceBoxSize, fromTransform);
     135    TransformationMatrix toTransform;
     136    apply(start, referenceBoxSize, toTransform);
    141137
    142     // Convert the TransformOperations into matrices
    143     TransformationMatrix fromTransform;
    144     TransformationMatrix toTransform;
    145     from.apply(boxSize, fromTransform);
    146     apply(boxSize, toTransform);
    147    
    148138    auto progress = context.progress;
    149139    auto compositeOperation = context.compositeOperation;
    150     if (shouldFallBackToDiscreteAnimation(from, boxSize)) {
     140    if (shouldFallBackToDiscreteAnimation(from, referenceBoxSize)) {
    151141        progress = progress < 0.5 ? 0 : 1;
    152142        compositeOperation = CompositeOperation::Replace;
    153143    }
     144
    154145    toTransform.blend(fromTransform, progress, compositeOperation);
    155     // Append the result
    156     result.operations().append(Matrix3DTransformOperation::create(toTransform));
    157 
    158     return result;
    159 }
    160 
    161 TransformOperations TransformOperations::blend(const TransformOperations& from, const BlendingContext& context, const LayoutSize& size) const
    162 {
    163     if (from == *this)
    164         return *this;
    165 
    166     if (from.size() && from.operationsMatch(*this))
    167         return blendByMatchingOperations(from, context, size);
    168 
    169     return blendByUsingMatrixInterpolation(from, context, size);
     146    return Matrix3DTransformOperation::create(toTransform);
    170147}
    171148
  • trunk/Source/WebCore/platform/graphics/transforms/TransformOperations.h

    r289862 r290667  
    4545    }
    4646   
    47     void apply(const FloatSize& sz, TransformationMatrix& t) const
     47    void apply(const FloatSize& size, TransformationMatrix& matrix) const { apply(0, size, matrix); }
     48    void apply(unsigned start, const FloatSize& size, TransformationMatrix& matrix) const
    4849    {
    49         for (unsigned i = 0; i < m_operations.size(); ++i)
    50             m_operations[i]->apply(t, sz);
     50        for (unsigned i = start; i < m_operations.size(); ++i)
     51            m_operations[i]->apply(matrix, size);
    5152    }
     53
    5254   
    5355    // Return true if any of the operation types are 3D operation types (even if the
    … …  
    7880    }
    7981
    80     bool operationsMatch(const TransformOperations&) const;
    81 
    82     // Find a list of transform primitives for the given TransformOperations which are compatible with the primitives
    83     // stored in sharedPrimitives. The results are written back into sharedPrimitives. This returns false if any element
    84     // of TransformOperation does not have a shared primitive, otherwise it returns true.
    85     bool updateSharedPrimitives(Vector<TransformOperation::OperationType>& sharedPrimitives) const;
    86    
    8782    void clear()
    8883    {
    … …  
    106101    bool shouldFallBackToDiscreteAnimation(const TransformOperations&, const LayoutSize&) const;
    107102   
    108     TransformOperations blendByMatchingOperations(const TransformOperations& from, const BlendingContext&, const LayoutSize&) const;
    109     TransformOperations blendByUsingMatrixInterpolation(const TransformOperations& from, const BlendingContext&, const LayoutSize&) const;
    110     TransformOperations blend(const TransformOperations& from, const BlendingContext&, const LayoutSize&) const;
     103    RefPtr<TransformOperation> createBlendedMatrixOperationFromOperationsSuffix(const TransformOperations& from, unsigned start, const BlendingContext&, const LayoutSize& referenceBoxSize) const;
     104    TransformOperations blend(const TransformOperations& from, const BlendingContext&, const LayoutSize&, std::optional<unsigned> prefixLength = std::nullopt) const;
    111105
    112106private:
    113107    Vector<RefPtr<TransformOperation>> m_operations;
     108};
     109
     110// SharedPrimitivesPrefix is used to find a shared prefix of transform function primitives (as
     111// defined by CSS Transforms Level 1 & 2). Given a series of TransformOperations in the keyframes
     112// of an animation. After update() is called with the TransformOperations of every keyframe,
     113// primitive() will return the prefix of primitives that are shared by all keyframes passed
     114// to update().
     115class SharedPrimitivesPrefix {
     116public:
     117    SharedPrimitivesPrefix() = default;
     118    virtual ~SharedPrimitivesPrefix() = default;
     119    void update(const TransformOperations&);
     120    bool hadIncompatibleTransformFunctions() { return m_indexOfFirstMismatch.has_value(); }
     121    const Vector<TransformOperation::OperationType>& primitives() { return m_primitives; }
     122
     123private:
     124    std::optional<size_t> m_indexOfFirstMismatch;
     125    Vector<TransformOperation::OperationType> m_primitives;
    114126};
    115127
Note: See TracChangeset for help on using the changeset viewer.