<?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>106940</bug_id>
          
          <creation_ts>2013-01-15 13:19:14 -0800</creation_ts>
          <short_desc>Suspend CSS animations for background tabs</short_desc>
          <delta_ts>2013-01-15 15:45:43 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Beth Dakin">bdakin</reporter>
          <assigned_to name="Beth Dakin">bdakin</assigned_to>
          <cc>bdakin</cc>
    
    <cc>dino</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>807629</commentid>
    <comment_count>0</comment_count>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2013-01-15 13:19:14 -0800</bug_when>
    <thetext>We should suspend CSS animations when a page is in the background.

&lt;rdar://problem/12961725&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807630</commentid>
    <comment_count>1</comment_count>
      <attachid>182838</attachid>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2013-01-15 13:20:57 -0800</bug_when>
    <thetext>Created attachment 182838
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807657</commentid>
    <comment_count>2</comment_count>
      <attachid>182838</attachid>
    <who name="Dean Jackson">dino</who>
    <bug_when>2013-01-15 13:46:53 -0800</bug_when>
    <thetext>Comment on attachment 182838
Patch

I&apos;m surprised that this is all it takes. I wonder if it should be a setting so ports could toggle it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807665</commentid>
    <comment_count>3</comment_count>
      <attachid>182838</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2013-01-15 13:53:18 -0800</bug_when>
    <thetext>Comment on attachment 182838
Patch

IIRC these suspend/resume calls don&apos;t work very well; if JS runs and starts an animation while animations are &quot;suspended&quot; it will actually run.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807666</commentid>
    <comment_count>4</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2013-01-15 13:54:22 -0800</bug_when>
    <thetext>Also, we have some bugs with fill mode iirc. But, we&apos;ll just have to fix all this :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807668</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2013-01-15 13:55:18 -0800</bug_when>
    <thetext>We also have Frame::suspendActiveDOMObjectsAndAnimations (added in r109548). Should we be using that instead? FocusController doesn&apos;t seem like the right place to do this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807739</commentid>
    <comment_count>6</comment_count>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2013-01-15 15:23:10 -0800</bug_when>
    <thetext>Actually, I think I found a place that I prefer for this code to live. I think it should be grouped with Kiran&apos;s DOM timer throttling (see http://trac.webkit.org/changeset/130720 ) which is in Page::setVisibilityState(). As far as I can tell, Page::setVisibilityState() and FocusController::setContainingWindowIsVisible() are pretty much equivalent, but it would be nice to have all of this throttling/suspending in the same place. I am going to post a new patch that moves this code to Page::setVisibilityState().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807740</commentid>
    <comment_count>7</comment_count>
      <attachid>182855</attachid>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2013-01-15 15:25:16 -0800</bug_when>
    <thetext>Created attachment 182855
Patch in Page

We might want to re-name HIDDEN_PAGE_DOM_TIMER_THROTTLING to HIDDEN_PAGE_THROTTLING if we go with this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807743</commentid>
    <comment_count>8</comment_count>
      <attachid>182855</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2013-01-15 15:29:44 -0800</bug_when>
    <thetext>Comment on attachment 182855
Patch in Page

I like this better but I don&apos;t think it should be inside #if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807764</commentid>
    <comment_count>9</comment_count>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2013-01-15 15:45:43 -0800</bug_when>
    <thetext>http://trac.webkit.org/changeset/139800</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>182838</attachid>
            <date>2013-01-15 13:20:57 -0800</date>
            <delta_ts>2013-01-15 15:25:16 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>for-review.txt</filename>
            <type>text/plain</type>
            <size>1369</size>
            <attacher name="Beth Dakin">bdakin</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEzOTc3OCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBACisyMDEzLTAxLTE1ICBCZXRoIERh
a2luICA8YmRha2luQGFwcGxlLmNvbT4KKworICAgICAgICBodHRw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hbmltYXRpb24oKS0+cmVzdW1lQW5pbWF0aW9ucygpOworICAgIGVsc2UKKyAg
ICAgICAgbV9wYWdlLT5tYWluRnJhbWUoKS0+YW5pbWF0aW9uKCktPnN1c3BlbmRBbmltYXRpb25z
KCk7CisKICAgICBmb3IgKEZyYW1lKiBmcmFtZSA9IG1fcGFnZS0+bWFpbkZyYW1lKCk7IGZyYW1l
OyBmcmFtZSA9IGZyYW1lLT50cmVlKCktPnRyYXZlcnNlTmV4dCgpKSB7CiAgICAgICAgIEZyYW1l
VmlldyogZnJhbWVWaWV3ID0gZnJhbWUtPnZpZXcoKTsKICAgICAgICAgaWYgKCFmcmFtZVZpZXcp
Cg==
</data>
<flag name="review"
          id="200994"
          type_id="1"
          status="+"
          setter="dino"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>182855</attachid>
            <date>2013-01-15 15:25:16 -0800</date>
            <delta_ts>2013-01-15 15:29:44 -0800</delta_ts>
            <desc>Patch in Page</desc>
            <filename>for-review-2.txt</filename>
            <type>text/plain</type>
            <size>1434</size>
            <attacher name="Beth Dakin">bdakin</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDEzOTc5OCkKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBACisyMDEzLTAxLTE1ICBCZXRoIERh
a2luICA8YmRha2luQGFwcGxlLmNvbT4KKworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9y
Zy9zaG93X2J1Zy5jZ2k/aWQ9MTA2OTQwCisgICAgICAgIFN1c3BlbmQgQ1NTIGFuaW1hdGlvb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ktPmFuaW1hdGlvbigpLT5zdXNwZW5kQW5pbWF0aW9ucygp
OworICAgIH0gZWxzZSB7CiAgICAgICAgIHNldFRpbWVyQWxpZ25tZW50SW50ZXJ2YWwoU2V0dGlu
Z3M6OmRlZmF1bHRET01UaW1lckFsaWdubWVudEludGVydmFsKCkpOworICAgICAgICBtYWluRnJh
bWUoKS0+YW5pbWF0aW9uKCktPnJlc3VtZUFuaW1hdGlvbnMoKTsKKyAgICB9CiAjaWYgIUVOQUJM
RShQQUdFX1ZJU0lCSUxJVFlfQVBJKQogICAgIFVOVVNFRF9QQVJBTShpc0luaXRpYWxTdGF0ZSk7
CiAjZW5kaWYK
</data>
<flag name="review"
          id="201018"
          type_id="1"
          status="+"
          setter="simon.fraser"
    />
          </attachment>
      

    </bug>

</bugzilla>