<?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>285277</bug_id>
          
          <creation_ts>2025-01-01 05:45:23 -0800</creation_ts>
          <short_desc>[view-transitions] The keyframes for effects on ::view-transition-group() pseudos are wrong</short_desc>
          <delta_ts>2025-01-08 17:34:41 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>282448</dup_id>
          
          <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 name="Bramus">bramus</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mattwoodrow</cc>
    
    <cc>ntim</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2084414</commentid>
    <comment_count>0</comment_count>
    <who name="Bramus">bramus</who>
    <bug_when>2025-01-01 05:45:23 -0800</bug_when>
    <thetext>In https://codepen.io/bramus/pen/NPKgvMY?editors=0010 I get the effect set on ::view-transition-group(box) pseudo. Once retrieved, I get and log the keyframes. As you can see the value for `transform` in the to keyframe is set to the same value as the from keyframe.

```js
[
    {
        &quot;offset&quot;: 0,
        &quot;easing&quot;: &quot;ease&quot;,
        &quot;composite&quot;: &quot;auto&quot;,
        &quot;transform&quot;: &quot;matrix(1, 0, 0, 1, 24, 371.5)&quot;,
        &quot;height&quot;: &quot;143px&quot;,
        &quot;backdropFilter&quot;: &quot;none&quot;,
        &quot;width&quot;: &quot;143px&quot;,
        &quot;computedOffset&quot;: 0
    },
    {
        &quot;offset&quot;: 1,
        &quot;easing&quot;: &quot;ease&quot;,
        &quot;composite&quot;: &quot;replace&quot;,
        &quot;transform&quot;: &quot;matrix(1, 0, 0, 1, 24, 371.5)&quot;, // 👈 This line
        &quot;height&quot;: &quot;auto&quot;,
        &quot;backdropFilter&quot;: &quot;none&quot;,
        &quot;width&quot;: &quot;auto&quot;,
        &quot;computedOffset&quot;: 1
    }
]
```

This does not represent reality and becomes problematic when trying to manipulate the keyframes. See https://codepen.io/bramus/pen/dPbzZra in where I first get the keyframes and then re-set them with only the `transform`: the box does not move at all because of its `transform` not changing.

```js
const boxKeyframes = boxGroupAnimation.effect.getKeyframes();
    
const newKeyframes = [
   { transform: boxKeyframes[0].transform },
   { transform: boxKeyframes[1].transform },
];

boxGroupAnimation.effect.setKeyframes(newKeyframes);
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2084415</commentid>
    <comment_count>1</comment_count>
    <who name="Bramus">bramus</who>
    <bug_when>2025-01-01 05:47:56 -0800</bug_when>
    <thetext>FWIW: Blink has a similar bug but it sets the to keyframe’s `transform` to `&quot;none&quot;` – https://issues.chromium.org/issues/387030974</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2084433</commentid>
    <comment_count>2</comment_count>
    <who name="Bramus">bramus</who>
    <bug_when>2025-01-01 11:46:48 -0800</bug_when>
    <thetext>Correction: In WebKit, it is the value for `boxKeyframes[0].transform` that is wrong (not the value of `boxKeyframes[1].transform` as I had reported in #c0)

By manually correcting the transform, as done in https://codepen.io/bramus/pen/OPLxrQN, all works fine:

```js
const rectBefore = document.querySelector(&apos;.box&apos;).getBoundingClientRect(); // 👈 This line

const t = document.startViewTransition(() =&gt; {
    setRandomAlignments();
});

await t.ready;

… (get effect on the pseudo and get its keyframes)

newKeyframes[0].transform = `matrix(1, 0, 0, 1, ${rectBefore.left}, ${rectBefore.top})`; // 👈 This line
boxGroupAnimation.effect.setKeyframes(newKeyframes);
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2084581</commentid>
    <comment_count>3</comment_count>
    <who name="Bramus">bramus</who>
    <bug_when>2025-01-02 15:37:30 -0800</bug_when>
    <thetext>Digging deeper: It’s the entire `from` keyframe that is wrong. See https://codepen.io/bramus/pen/ogvobYQ?editors=0010 in which I change the size of the element as well. The `from` keyframe also shows the `to` keyframe’s `width` and `height` which is incorrect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085771</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-01-08 05:46:13 -0800</bug_when>
    <thetext>&lt;rdar://problem/142544113&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085941</commentid>
    <comment_count>5</comment_count>
    <who name="Matt Woodrow">mattwoodrow</who>
    <bug_when>2025-01-08 17:34:30 -0800</bug_when>
    <thetext>Thanks for reporting this!

Looks like this got fixed by bug 282448, which should be in STP and Safari 18.3 Beta now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2085942</commentid>
    <comment_count>6</comment_count>
    <who name="Matt Woodrow">mattwoodrow</who>
    <bug_when>2025-01-08 17:34:41 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 282448 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>