<?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>143488</bug_id>
          
          <creation_ts>2015-04-07 11:20:59 -0700</creation_ts>
          <short_desc>[Gtk] Animation is not stopped when animation class is removed</short_desc>
          <delta_ts>2017-03-11 11:03:36 -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>Unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eduard Kegulskiy">ed_dvd</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>dino</cc>
    
    <cc>ed_dvd</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1083355</commentid>
    <comment_count>0</comment_count>
      <attachid>250278</attachid>
    <who name="Eduard Kegulskiy">ed_dvd</who>
    <bug_when>2015-04-07 11:20:59 -0700</bug_when>
    <thetext>Created attachment 250278
HTML file showing the problem

The problem is found with GTK port when accelerated Compositing is used.

The attached test application is doing the following steps:
1. Apply translateZ(0) to &lt;p&gt; element
2. Apply CSS class called .delayedScrollingLabelA.animate to perform animation using -webkit-animation property.
3. Remove .delayedScrollingLabelA.animate class.

At step (3), it is expected that animation should stop, however it continues. The problem does not happen if step (1) is omitted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1083364</commentid>
    <comment_count>1</comment_count>
    <who name="Eduard Kegulskiy">ed_dvd</who>
    <bug_when>2015-04-07 11:31:02 -0700</bug_when>
    <thetext>The problem seems to be in GraphicsLayerTextureMapper class.

Specifically, when animation is added, the GraphicsLayerTextureMapper::addAnimation() is called which does 2 things:
1. add new animation to m_animations set
2. calls notifyChange(AnimationChange) to notify m_layer that its own internal set of animations has been modified.

However, when animation is removed via GraphicsLayerTextureMapper::removeAnimation(), the code only removes the animation from the m_animations set, but does not notify the m_layer.

The proposed patch would be to add notifyChange(AnimationChange) call to both removeAnimation() and pauseAnimation() as following:

void GraphicsLayerTextureMapper::pauseAnimation(const String&amp; animationName, double timeOffset)
{
    m_animations.pause(animationName, timeOffset);
    notifyChange(AnimationChange);
}

void GraphicsLayerTextureMapper::removeAnimation(const String&amp; animationName)
{
    m_animations.remove(animationName);
    notifyChange(AnimationChange);
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084010</commentid>
    <comment_count>2</comment_count>
    <who name="Eduard Kegulskiy">ed_dvd</who>
    <bug_when>2015-04-09 11:48:35 -0700</bug_when>
    <thetext>Hi Alexei,

do you think this bug is GTK-only? The GraphicsLayerTextureMapper class seems to be common code for all ports since it resides under webcore/platform/graphics/texmap folder?

(sorry if I misunderstand something, I am new to webkit development community)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>250278</attachid>
            <date>2015-04-07 11:20:59 -0700</date>
            <delta_ts>2015-04-07 11:20:59 -0700</delta_ts>
            <desc>HTML file showing the problem</desc>
            <filename>animation_class_remove.html</filename>
            <type>text/html</type>
            <size>1870</size>
            <attacher name="Eduard Kegulskiy">ed_dvd</attacher>
            
              <data encoding="base64">PGh0bWw+DQo8aGVhZD4NCjxzdHlsZT4NCi5kZWxheWVkU2Nyb2xsaW5nTGFiZWxBIHsNCgl3aGl0
ZS1zcGFjZTogcHJlOw0KCXBv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