<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>236397</bug_id>
          
          <creation_ts>2022-02-09 12:26:45 -0800</creation_ts>
          <short_desc>[css-transforms] transform animation on SVG element jumps as it ends</short_desc>
          <delta_ts>2025-08-22 02:31:35 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Animations</component>
          <version>Safari 15</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>halifirien</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>graouts</cc>
    
    <cc>halifirien</cc>
    
    <cc>mrobinson</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1839349</commentid>
    <comment_count>0</comment_count>
      <attachid>451425</attachid>
    <who name="">halifirien</who>
    <bug_when>2022-02-09 12:26:45 -0800</bug_when>
    <thetext>Created attachment 451425
matrix-transform-jump-demo

using animate on svg &lt;g&gt; with matrix transform keyframes. It completes the animation to the wrong position - and then instantaneously jumps to the correct position.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839714</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-02-10 09:11:32 -0800</bug_when>
    <thetext>&lt;rdar://problem/88758676&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839748</commentid>
    <comment_count>2</comment_count>
      <attachid>451558</attachid>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-02-10 09:57:24 -0800</bug_when>
    <thetext>Created attachment 451558
Slight reduced test

I&apos;ve reduced the test a bit to not visibly interpolate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839855</commentid>
    <comment_count>3</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-02-10 11:42:00 -0800</bug_when>
    <thetext>RenderStyle::applyTransform() gets called once at the beginning of the animation and once at the end. Logging transformOperations shows that it differs between the two calls while originTranslate is a zero point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839859</commentid>
    <comment_count>4</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-02-10 11:52:34 -0800</bug_when>
    <thetext>The first set of transformOperations doesn&apos;t match what is being provided to the animate() call.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839864</commentid>
    <comment_count>5</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-02-10 12:09:42 -0800</bug_when>
    <thetext>The call to CSSPropertyAnimation::blendProperties() in KeyframeEffect::setAnimatedPropertiesInStyle() takes two identical transforms which are correct and generates an incorrect one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839869</commentid>
    <comment_count>6</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-02-10 12:20:42 -0800</bug_when>
    <thetext>This simple diff fixes the bug:

diff --git a/Source/WebCore/animation/CSSPropertyAnimation.cpp b/Source/WebCore/animation/CSSPropertyAnimation.cpp
index 217e768c131d..f7338e6ccc40 100644
--- a/Source/WebCore/animation/CSSPropertyAnimation.cpp
+++ b/Source/WebCore/animation/CSSPropertyAnimation.cpp
@@ -171,6 +171,9 @@ static inline TransformOperations blendFunc(const TransformOperations&amp; from, con
         return resultOperations;
     }
 
+    if (from == to)
+        return from;
+
     if (context.client-&gt;transformFunctionListsMatch())
         return to.blendByMatchingOperations(from, context);
     return to.blendByUsingMatrixInterpolation(from, context, is&lt;RenderBox&gt;(context.client-&gt;renderer()) ? downcast&lt;RenderBox&gt;(*context.client-&gt;renderer()).borderBoxRect().size() : LayoutSize());

But I&apos;m not sure if this is the best fix. On the one hand, this is probably a good thing to do in general, but it also feels like this might be hiding an issue further down in the blending code where we would also yield an incorrect result with non-equal matrices.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839871</commentid>
    <comment_count>7</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-02-10 12:27:36 -0800</bug_when>
    <thetext>Also, this doesn&apos;t fix the original test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2137396</commentid>
    <comment_count>8</comment_count>
    <who name="">halifirien</who>
    <bug_when>2025-08-19 04:45:27 -0700</bug_when>
    <thetext>The jump at the end of the animation is no longer happening on Safari 18.6 (20621.3.11.11.3) MacOS 15.6

I can&apos;t tell you when it was fixed, but I believe it was fairly recently</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>451425</attachid>
            <date>2022-02-09 12:26:45 -0800</date>
            <delta_ts>2022-02-09 12:26:45 -0800</delta_ts>
            <desc>matrix-transform-jump-demo</desc>
            <filename>iso.html</filename>
            <type>text/html</type>
            <size>2366</size>
            <attacher>halifirien</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KICA8aGVhZD4KICAgIDx0aXRsZT5zdmcg
Z2V0RW5jbG9zdXJlTGlzdDwvdGl0bGU+CiAgPC9oZWFkPgogIDxzY3JpcHQgdHlwZT0ibW9kdWxl
Ij4KICAgIGNvbnN0IGlzb21ldHJpY01hdHJpeCA9IChzdmcpID0+I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VwID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignZycpCiAgICAg
IGdyb3VwLnRyYW5zZm9ybS5iYXNlVmFsLmNsZWFyKCkKICAgICAgaXNvbWV0cmljVmlldyhkb2N1
bWVudC5xdWVyeVNlbGVjdG9yKCdzdmcnKSwgZ3JvdXApCiAgICB9KQogIDwvc2NyaXB0PgogIDxi
b2R5PgogICAgPHN2ZyB3aWR0aD0iNjAwIiBoZWlnaHQ9JzUwMCcgdmlld0JveD0iMCAwIDYwMCA1
MDAiPgogICAgICA8Zz4KICAgICAgICA8cmVjdCB4PSIxMDAiIHk9IjEwMCIgd2lkdGg9IjE2MCIg
aGVpZ2h0PSIzMDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iYmxhY2siLz4KICAgICAgICA8cmVjdCB4
PSIzMDAiIHk9IjMwMCIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9Im5vbmUiIHN0cm9r
ZT0iYmxhY2siLz4KICAgICAgICA8cmVjdCB4PSIzMDAiIHk9IjIwMCIgd2lkdGg9IjEwMCIgaGVp
Z2h0PSIxMDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iYmxhY2siLz4KICAgICAgPC9nPgogICAgPC9z
dmc+CiAgICA8YnV0dG9uIHN0eWxlPSJ3aGl0ZS1zcGFjZTogcHJlOyI+QW5pbWF0ZSBJc29tZXRy
aWM8L2J1dHRvbj4KICA8L2JvZHk+CjwvaHRtbD4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>451558</attachid>
            <date>2022-02-10 09:57:24 -0800</date>
            <delta_ts>2022-02-10 09:57:24 -0800</delta_ts>
            <desc>Slight reduced test</desc>
            <filename>bug-236397.html</filename>
            <type>text/html</type>
            <size>1342</size>
            <attacher name="Antoine Quint">graouts</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KICA8aGVhZD4KICAgIDx0a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