<?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>23775</bug_id>
          
          <creation_ts>2009-02-05 16:39:09 -0800</creation_ts>
          <short_desc>Transitions misbehave when a property is expressed in different units</short_desc>
          <delta_ts>2026-02-09 06:47:07 -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>Animations</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=245179</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, HasReduction, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Benoit Marchant">marchant</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bdakin</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cedricv</cc>
    
    <cc>dino</cc>
    
    <cc>divya</cc>
    
    <cc>graouts</cc>
    
    <cc>rik</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit.org</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108552</commentid>
    <comment_count>0</comment_count>
    <who name="Benoit Marchant">marchant</who>
    <bug_when>2009-02-05 16:39:09 -0800</bug_when>
    <thetext>In the attached test case, the width doesn&apos;t animate because it&apos;s expressed as % at the beginning and as em when the transition should apply</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108553</commentid>
    <comment_count>1</comment_count>
      <attachid>27370</attachid>
    <who name="Benoit Marchant">marchant</who>
    <bug_when>2009-02-05 16:40:18 -0800</bug_when>
    <thetext>Created attachment 27370
Test case for the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108556</commentid>
    <comment_count>2</comment_count>
    <who name="Deirdre Saoirse Moen">desamo</who>
    <bug_when>2009-02-05 17:39:59 -0800</bug_when>
    <thetext>rdar://problem/6561547</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>416280</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2011-06-06 21:09:49 -0700</bug_when>
    <thetext>*** Bug 54647 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>507909</commentid>
    <comment_count>4</comment_count>
    <who name="Mike Lawther">mikelawther</who>
    <bug_when>2011-11-22 19:25:19 -0800</bug_when>
    <thetext>*** Bug 63309 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1895643</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-01 16:34:48 -0700</bug_when>
    <thetext>I am not able to reproduce issue in reference to animation but the animation ends abruptly if mouse leaves container and come back in Safari Technology Preview 152 and it is not same as other browsers, where the animation ends back smoothly.

Do you want me to create separate bug for that and close this? Appreciate if someone can comment. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1895940</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-09-02 17:46:41 -0700</bug_when>
    <thetext>Good catch. This problem with interrupted transition only reproduces when the units are different, so I would say that it&apos;s a part of the original bug, and can continue to be tracked here.

Re-titled a bit to that effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898443</commentid>
    <comment_count>7</comment_count>
      <attachid>462331</attachid>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-09-14 05:30:27 -0700</bug_when>
    <thetext>Created attachment 462331
Improved testcase

In the attached improved testcase, we automatically trigger, reverse the transition and log the values provided by the Web Animations API which are all out of whack in WebKit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898444</commentid>
    <comment_count>8</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-09-14 05:35:28 -0700</bug_when>
    <thetext>Firefox / Chrome (actual values may vary):

Transitioning width from 10% to 960px
Transitioning width from calc(6.63989% + 322.571px) to 10%

Safari:

Transitioning width from 151.1875px to 151.1875px
Transitioning width from 151.1875px to 151.1875px

What puzzles me is that the from/to values are the same for the initial transition even though we do the right thing in terms of rendering. The second one is consistent with the fact that we snap, although it makes no sense to transition between two equal values.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898445</commentid>
    <comment_count>9</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-09-14 05:40:59 -0700</bug_when>
    <thetext>We are getting 10% and 960px values in the RenderStyle objects provided when creating the CSSTransition object.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898454</commentid>
    <comment_count>10</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-09-14 06:33:43 -0700</bug_when>
    <thetext>Huh-ho, so for the getKeyframes() issue the problem is that we are calling this method to get the computed value from the style in the addPropertyToKeyframe lambda:

computedStyleExtractor.valueForPropertyInStyle(style, cssPropertyId, renderer)

But this absolutely does not use the provided style object to get the width instead using the current bounds for the renderer. Not good!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898462</commentid>
    <comment_count>11</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-09-14 07:51:10 -0700</bug_when>
    <thetext>Filed bug 245179 for the getKeyframes() issue which is unrelated to the fact that we&apos;re not visibly animating for transition reversal.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1899497</commentid>
    <comment_count>12</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-09-19 09:03:54 -0700</bug_when>
    <thetext>The issue is under static Length blendMixedTypes(const Length&amp; from, const Length&amp; to, const BlendingContext&amp; context) where we have from = calc(blend(10%, 960px, 0.33)) and to = 10% but the result is calc(blend(10%, 10%, …)).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1899500</commentid>
    <comment_count>13</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-09-19 09:05:24 -0700</bug_when>
    <thetext>I think this might be the culprit:

CalcExpressionBlendLength::CalcExpressionBlendLength(Length from, Length to, float progress)
    : CalcExpressionNode(CalcExpressionNodeType::BlendLength)
    , m_from(from)
    , m_to(to)
    , m_progress(progress)
{
    // Flatten nesting of CalcExpressionBlendLength as a speculative fix for rdar://problem/30533005.
    // CalcExpressionBlendLength is only used as a result of animation and they don&apos;t nest in normal cases.
    if (m_from.isCalculated() &amp;&amp; m_from.calculationValue().expression().type() == CalcExpressionNodeType::BlendLength)
        m_from = downcast&lt;CalcExpressionBlendLength&gt;(m_from.calculationValue().expression()).from();
    if (m_to.isCalculated() &amp;&amp; m_to.calculationValue().expression().type() == CalcExpressionNodeType::BlendLength)
        m_to = downcast&lt;CalcExpressionBlendLength&gt;(m_to.calculationValue().expression()).to();
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1899501</commentid>
    <comment_count>14</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-09-19 09:07:42 -0700</bug_when>
    <thetext>Indeed, removing that code fixes the issue. But this fixed a crash so we probably need to find a better way to flatten blend calculation values here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2178715</commentid>
    <comment_count>15</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2026-02-06 02:01:04 -0800</bug_when>
    <thetext>@Antoine - I am unable to reproduce this bug on Safari Technology Preview 236 and neither could I find comment about rdar://problem/30533005 anymore? Could be fixed by Sam&apos;s rewrite of calc()?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2179435</commentid>
    <comment_count>16</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2026-02-09 06:46:56 -0800</bug_when>
    <thetext>I think this is the case. I simply can&apos;t go far enough in history to find a failing Safari to then find when this progressed.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>27370</attachid>
            <date>2009-02-05 16:40:18 -0800</date>
            <delta_ts>2009-02-05 16:40:18 -0800</delta_ts>
            <desc>Test case for the bug</desc>
            <filename>BugWidth.html</filename>
            <type>text/html</type>
            <size>884</size>
            <attacher name="Benoit Marchant">marchant</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFs
Ly9FTiIKCSJodHRwOi8vd3d3LnczLm9yZy9UUi94aHRtbDEvRFREL3hodG1sMS10cmFuc2l0aW9u
YWwuZHRkIj4KCjxodG1sIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIiB4bWw6
bGFuZz0iZW4iIGxhbmc9ImVuIj4KPGhlYWQ+Cgk8dGl0bGU+Q1NTQW5pbWF0aW9uVGVzdDwvdGl0
bGU+CgoJPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCQkKCQkuc3RhcnR7CiAgICAgICAgICAgIC13
ZWJraXQtdHJhbnNpdGlvbi1kdXJhdGlvbjogM3M7CiAgICAgICAgICAgIC13ZWJraXQtdHJhbnNp
dGlvbi1wcm9wZXJ0eTogd2lkdGg7CiAgICAgICAgICAgIC13ZWJraXQtdHJhbnNpdGlvbi10aW1p
bmctZnVuY3Rpb246IGVhc2U7CgkJCWJhY2tncm91bmQtY29sb3I6IGJsdWU7CgkJCWNvbG9yOiBi
bGFjazsKCQkJZm9udC1zaXplIDogMjBweDsKCQkJaGVpZ2h0IDogNzBweDsKCQkJd2lkdGggOiA0
MCU7CgkJCXBvc2l0aW9uOmFic29sdXRlOwoJCQlwYWRkaW5nOjEwcHg7CgkJCXRvcCA6IDEwMHB4
OwoJCQlsZWZ0IDogMTEwcHg7CgkJCWJvcmRlcjogMnB4IHNvbGlkIGRhcmttYWdlbnRhOwoJCX0K
CQkKCQkjY2xpY01lOmhvdmVyIHsKCQkJd2lkdGggOiA2MGVtOwoJCX0KCQkKCTwvc3R5bGU+ICAK
PC9oZWFkPgoKPGJvZHkgaWQ9IkdpYW5kdWlhLnRlc3QuQXBwS2l0LnRlc3ROU0NvbXBvbmVudCI+
Cgk8aDE+RXhhbXBsZSBvZiB1c2FnZSBvZiBOU0NTU0FuaW1hdGlvbjwvaDE+Cgk8ZGl2IGlkPSJj
bGljTWUiIGNsYXNzPSJzdGFydCIgIG9uY2xpY2s9InRlc3RBbmltYXRpb25zKCk7IiA+CgkJQ2xp
YyBNZQoJPC9kaXY+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>462331</attachid>
            <date>2022-09-14 05:30:27 -0700</date>
            <delta_ts>2022-09-14 05:30:27 -0700</delta_ts>
            <desc>Improved testcase</desc>
            <filename>bug-23775.html</filename>
            <type>text/html</type>
            <size>774</size>
            <attacher name="Antoine Quint">graouts</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgoJPHRpdGxlPlRlc3QgZm9yIGJ1ZyAyMzc3NTwvdGl0bGU+Cgk8c3R5bGU+
CgkJCmRpdiB7Cglwb3NpdGlvbjogYWJzb2x1dGU7Cgl0b3A6IDEwMHB4OwoJbGVmdDogMTAwcHg7
Cgl3aWR0aDogMTAlOwoJaGVpZ2h0OiA3MHB4OwoKCWJhY2tncm91bmQtY29sb3I6IGJsYWNrOwog
ICAgdHJhbnNpdGlvbjogd2lkdGggM3Mg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