<?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>146451</bug_id>
          
          <creation_ts>2015-06-30 02:41:35 -0700</creation_ts>
          <short_desc>The animation is running in the background without stop.</short_desc>
          <delta_ts>2023-04-13 01:52:44 -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>Animations</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>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Wang">mwang</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1105651</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Wang">mwang</who>
    <bug_when>2015-06-30 02:41:35 -0700</bug_when>
    <thetext>This issue happens only if accelerated-compositing is enabled.

The attached simple test case is to load an iframe with &apos;display:none&apos;, which has some animations. Although nothing is displayed when it is loaded, 50% CPU is consumed (depends on different platform).  

If adding a log in ImplicitAnimation::timeToNextService() of ImplicitAnimation.cpp
double ImplicitAnimation::timeToNextService()
{
    printf(&quot;[LOG]ImplicitAnimation::timeToNextService(%p)\n&quot;, this);
    double t = AnimationBase::timeToNextService();
    ......
}

Lots of logs were outputted in the console, like 
    [LOG]ImplicitAnimation::timeToNextService(0x726e9ec8)
    [LOG]ImplicitAnimation::timeToNextService(0x726e9e70)
    [LOG]ImplicitAnimation::timeToNextService(0x726e9000)
    [LOG]ImplicitAnimation::timeToNextService(0x726e9058)
    [LOG]ImplicitAnimation::timeToNextService(0x726e9ec8)
    [LOG]ImplicitAnimation::timeToNextService(0x726e9e70)
    [LOG]ImplicitAnimation::timeToNextService(0x726e9f78)
    [LOG]ImplicitAnimation::timeToNextService(0x726e9f20)
    [LOG]ImplicitAnimation::timeToNextService(0x726e9058)
    [LOG]ImplicitAnimation::timeToNextService(0x726e9000)

How to reproduce this issue?
1/ unzip simple_case.zip
2/ enable accelerated-compositing
3/ load unzipped tbc.html 

The reason is in GraphicsLayerTextureMapper::addAnimation(). 
This issue is the side-effect of replacing m_animationStartedTimer.startOneShot(0) by notifyChange(AnimationStarted) in GraphicsLayerTextureMapper::addAnimation(). In fact, if the current GraphicsLayerTextureMapper object is not in GraphicsLayer tree, like the iframe in the attached simple case, it&apos;s GraphicsLayerTextureMapper::commitLayerChanges() can&apos;t be triggered, so AnimationStarted event can&apos;t be dispatched into AnimationController to stop the animation timer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105652</commentid>
    <comment_count>1</comment_count>
      <attachid>255817</attachid>
    <who name="Mark Wang">mwang</who>
    <bug_when>2015-06-30 02:43:50 -0700</bug_when>
    <thetext>Created attachment 255817
the simple case to reproduce this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105928</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Wang">mwang</who>
    <bug_when>2015-06-30 18:56:33 -0700</bug_when>
    <thetext>Simon, could you verify if this issuce can be reproduced with recent Safar? Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105938</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2015-06-30 19:13:55 -0700</bug_when>
    <thetext>No, I don&apos;t see any animations running in the iframe in Mac Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1105941</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Wang">mwang</who>
    <bug_when>2015-06-30 19:20:26 -0700</bug_when>
    <thetext>There is no any animation displayed on screen when it is running, but it causes CPU to be busy because timer of AnimationController is continually created and destroyed.

The best way is to add a log in ImplicitAnimation::timeToNextService() as my first comment, and then load the attached simple case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1948465</commentid>
    <comment_count>5</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2023-04-13 01:52:44 -0700</bug_when>
    <thetext>The code in question has been removed from WebKit.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>255817</attachid>
            <date>2015-06-30 02:43:50 -0700</date>
            <delta_ts>2015-06-30 02:43:50 -0700</delta_ts>
            <desc>the simple case to reproduce this issue.</desc>
            <filename>simple_case.zip</filename>
            <type>application/octet-stream</type>
            <size>1395</size>
            <attacher name="Mark Wang">mwang</attacher>
            
              <data encoding="base64">UEsDBBQAAAAIAHVIOUXoaCU4ZgEAABEDAAALAAAAc3VidGJjLmh0bWyVU8FOwzAMvfcrrJxAonQd
QkJdugMgceAI4p42hljLmtK43SrEv9NmHTAQIHyIXvJix352pOG1XUYwmDSo9FKukRUY5jrG55a6
XFy5irHi+L6vUUC52+WCccvJ6L2A0qjGI+c3l7diisXEFpf36BkeSKODDbGBq7u7M5nsuAik5z6A
ySy9w5cIPlntPDG5KmvQKqYOFwd0vMFiRRxzoyr/6Jp1FtBwFc/00azensB+geNfXMMbsW4bFR6D
+cwf3na1Kon7DGanF4eMQXoyPLrU20NGk6+t6rPCunL1JVyHzaN1m8yQ1lh9kK/vqLV/SaIK72zL
/5IkDXKkP4myIc0mm59/q8WS5zg0LeZhGLLKVfivkiKZTD2XSZi2SBZO9xAOc1GocvXUuLbScems
azLo0Q7RFruM0vlsTMkE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