Bug 143488 - [Gtk] Animation is not stopped when animation class is removed
Summary: [Gtk] Animation is not stopped when animation class is removed
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-07 11:20 PDT by Eduard Kegulskiy
Modified: 2017-03-11 11:03 PST (History)
3 users (show)

See Also:


Attachments
HTML file showing the problem (1.83 KB, text/html)
2015-04-07 11:20 PDT, Eduard Kegulskiy
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eduard Kegulskiy 2015-04-07 11:20:59 PDT
Created attachment 250278 [details]
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 <p> 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.
Comment 1 Eduard Kegulskiy 2015-04-07 11:31:02 PDT
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& animationName, double timeOffset)
{
    m_animations.pause(animationName, timeOffset);
    notifyChange(AnimationChange);
}

void GraphicsLayerTextureMapper::removeAnimation(const String& animationName)
{
    m_animations.remove(animationName);
    notifyChange(AnimationChange);
}
Comment 2 Eduard Kegulskiy 2015-04-09 11:48:35 PDT
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)