<?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>104496</bug_id>
          
          <creation_ts>2012-12-09 14:41:43 -0800</creation_ts>
          <short_desc>SVG animations do not support dynamic condition targets</short_desc>
          <delta_ts>2026-01-29 12:36:04 -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>SVG</component>
          <version>420+</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar, LayerBasedSVGEngine</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>103811</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philip Rogers">pdr</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>fmalita</cc>
    
    <cc>graouts</cc>
    
    <cc>krit</cc>
    
    <cc>rniwa</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>schenney</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>786873</commentid>
    <comment_count>0</comment_count>
      <attachid>178440</attachid>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2012-12-09 14:41:43 -0800</bug_when>
    <thetext>Created attachment 178440
Testcase

Consider this example:

&lt;rect id=&quot;rectRed&quot; width=&quot;100&quot; height=&quot;100&quot; x=&quot;0&quot; y=&quot;0&quot; fill=&quot;red&quot;/&gt;
&lt;rect id=&quot;rectGreen&quot; width=&quot;100&quot; height=&quot;100&quot; x=&quot;100&quot; y=&quot;0&quot; fill=&quot;green&quot;/&gt;
&lt;set id=&quot;set&quot; attributeName=&quot;x&quot; to=&quot;0&quot; xlink:href=&quot;#rectRed&quot; begin=&quot;click&quot;/&gt;

&lt;script&gt;
var animation = document.getElementById(&apos;set&apos;);
animation.setAttributeNS(&apos;http://www.w3.org/1999/xlink&apos;, &apos;xlink:href&apos;, &apos;#rectGreen&apos;);
&lt;/script&gt;


When we move the animation target from the red rect to the green rect, the click animation condition should move too but it does not. This currently works in Firefox and Opera.

A related issue is detecting dynamic id changes such as if &quot;blueRect.click&quot; was used as the begin condition and blueRect&apos;s id was changed. One way to fix these issues would be to add condition targets to our target tracking infrastructure in SVGDocumentExtensions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1881956</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-10 11:37:22 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari 15.5 on macOS 12.4 and Safari Technical Preview 148 using attached test case.

As per instruction, upon clicking &quot;green&quot; box, does not animate over to red box. Although, it does for other browsers such as Chrome Canary 105 and Firefox Nightly 104.

If I am testing it incorrectly, please retest accordingly. I tested using private window. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1884334</commentid>
    <comment_count>2</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-15 15:50:28 -0700</bug_when>
    <thetext>Works in Chrome and Firefox, fails in Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1884335</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-15 15:50:40 -0700</bug_when>
    <thetext>&lt;rdar://problem/97098583&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2176300</commentid>
    <comment_count>4</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2026-01-29 12:36:04 -0800</bug_when>
    <thetext>This fixes for me:

```
void SVGSMILElement::setTargetElement(SVGElement* target)
{
    if (RefPtr timeContainer = m_timeContainer; timeContainer &amp;&amp; hasValidAttributeName()) {
        if (RefPtr targetElement = m_targetElement.get())
            timeContainer-&gt;unschedule(this, targetElement.get(), m_attributeName);
        if (target)
            timeContainer-&gt;schedule(this, target, m_attributeName);
    }

    // Check if we have event conditions that implicitly use the target element.
    bool hasImplicitTargetConditions = false;
    for (auto&amp; condition : m_conditions) {
        if (condition.m_type == Condition::EventBase &amp;&amp; condition.m_baseID.isEmpty()) {
            hasImplicitTargetConditions = true;
            break;
        }
    }

    if (RefPtr targetElement = m_targetElement.get()) {
        // Clear values that may depend on the previous target.
        stopAnimation(targetElement.get());

        // Only disconnect/reconnect if we have conditions that depend on the target.
        if (hasImplicitTargetConditions)
            disconnectConditions();
    }

    // If the animation state is not Inactive, always reset to a clear state before leaving the old target element.
    if (m_activeState != Inactive)
        endedActiveInterval();

    m_targetElement = target;

    // Reconnect conditions if we have implicit target conditions
    if (hasImplicitTargetConditions &amp;&amp; target &amp;&amp; isConnected())
        connectConditions();
}
```</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>178440</attachid>
            <date>2012-12-09 14:41:43 -0800</date>
            <delta_ts>2012-12-09 14:41:43 -0800</delta_ts>
            <desc>Testcase</desc>
            <filename>events.html</filename>
            <type>text/html</type>
            <size>913</size>
            <attacher name="Philip Rogers">pdr</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8Ym9keT4KICBUZXN0IHRoYXQgYW5pbWF0aW9uIGNvbmRp
dGlvbnMgYXJlIHRpZWQgdG8gdGhlIGFuaW1hdGlvbidzIHRhcmd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