Bug 143488

Summary: [Gtk] Animation is not stopped when animation class is removed
Product: WebKit Reporter: Eduard Kegulskiy <ed_dvd>
Component: AnimationsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bugs-noreply, dino, ed_dvd
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Linux   
Attachments:
Description Flags
HTML file showing the problem none

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)