<?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>85059</bug_id>
          
          <creation_ts>2012-04-27 06:34:00 -0700</creation_ts>
          <short_desc>CSS Transitions vs. SMIL Animations race condition</short_desc>
          <delta_ts>2022-07-15 14:37:49 -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>CSS</component>
          <version>528+ (Nightly build)</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></keywords>
          <priority>P1</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>41761</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolas Zimmermann">zimmermann</reporter>
          <assigned_to name="Nikolas Zimmermann">zimmermann</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>krit</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>611438</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2012-04-27 06:34:00 -0700</bug_when>
    <thetext>CSS Transitions vs. SMIL Animations race condition.

Testcase:
&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
&lt;style&gt;
    rect {
        fill: teal;
        -webkit-transition-property: fill;
        -webkit-transition-duration: 0.5s;
    }
&lt;/style&gt;
 
&lt;rect width=&quot;100&quot; height=&quot;100&quot;&gt;
  &lt;animate attributeName=&quot;fill&quot; from=&quot;black&quot; to=&quot;purple&quot; fill=&quot;freeze&quot; dur=&quot;3s&quot; begin=&quot;3s&quot;/&gt;
&lt;/rect&gt;
&lt;/svg&gt;

You&apos;ll see no animation at all in trunk, it stays teal, and switches to purple at 3s, using a transition from teal to purple!
If you inspect what&apos;s going on you&apos;ll find that each SMIL induced CSS property change, triggers a CSS transitions from the lastAnimatedValue to the nextAnimatedValue.

It gets racy eg. for -webkit-transition-duration: 0.025s, which is the same time as the SMIL/CSS animation timers. I&apos;ll flag this as major bug.

Long description:
Each time SMIL changes a CSS property in the separated SMIL properties ruleset, we&apos;ll trigger a SyntheticStyleChange. This in turn causes the RenderStyle of the target RenderObject to be updated, via setAnimatableStyle. The RenderStyle contains the new &apos;fill&apos; value from the SMIL animation. So far so good.
Now setStyle(AnimationController::updateAnimations(renderer, style)) is called, which detects that &apos;fill&apos; changed, and a CSS transition is associated with that, so it starts/queues a CSS transitions from lastAnimatedVAlue to nextAnimatedValue, and so on.

Mozilla used to suffer from the same problem, they&apos;ve solved it by never executing any transition for a CSS property change due to SMIL animations. We need to work out how we can see this information in AnimationController / RenderObject / ... Suggestions?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1884237</commentid>
    <comment_count>1</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-15 14:37:49 -0700</bug_when>
    <thetext>Safari, Chrome, and Firefox all agree on rendering for this test case. I don&apos;t believe there is any remaining compatibility issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>