<?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>27238</bug_id>
          
          <creation_ts>2009-07-13 14:53:34 -0700</creation_ts>
          <short_desc>Animated GIF dynamically removed and readded to page does not re-animate</short_desc>
          <delta_ts>2026-03-03 12:03: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>Images</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Peter Kasting">pkasting</reporter>
          <assigned_to name="Peter Kasting">pkasting</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>dglazkov</cc>
    
    <cc>japhet</cc>
    
    <cc>kbolisetty</cc>
    
    <cc>koivisto</cc>
    
    <cc>mrahaman</cc>
    
    <cc>mustaf.here</cc>
    
    <cc>pkasting</cc>
    
    <cc>ravi.kasibhatla</cc>
    
    <cc>rudloff</cc>
    
    <cc>spottabathini</cc>
    
    <cc>vswap65</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>131415</commentid>
    <comment_count>0</comment_count>
      <attachid>32681</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2009-07-13 14:53:34 -0700</bug_when>
    <thetext>Created attachment 32681
Testcase

Open the attached testcase.  Hitting &quot;Play&quot; repeatedly should repeatedly animate the image.  This works fine in Firefox/IE but fails in Safari/Google Chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>445104</commentid>
    <comment_count>1</comment_count>
    <who name="Swapna P">vswap65</who>
    <bug_when>2011-08-01 22:20:00 -0700</bug_when>
    <thetext>Hi 
I am Working on this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>449072</commentid>
    <comment_count>2</comment_count>
      <attachid>103461</attachid>
    <who name="Swapna P">vswap65</who>
    <bug_when>2011-08-10 03:56:29 -0700</bug_when>
    <thetext>Created attachment 103461
Added resetAnimation() fuction call in order to restart animation 

For each click, it is creating one pair of instances of HTMLImageElement &amp; RenderImage but they all share the same BitmapImage instance for animation.

For the first click of play button , image is getting animated. If we click for 2nd time, it again calls for BitmapImage::startAnimation() but because the animation is currently continuing, the function just returns without doing anything. But the expected behavior is that for each click, all the existing image animations has to be restarted as IE/FF does.

So, therefore we need to somehow call resetAnimation() for the above behavior in each button click &amp; that&apos;s why when the new image being appended, we are calling resetAnimation().

I have thought about all the corner cases to make sure that this change will not have any side effect. Please let me know your opinion.

I have not yet added the test case for this. If the code changes are fine, I will add the test case &amp; upload a final patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>449076</commentid>
    <comment_count>3</comment_count>
      <attachid>103461</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-08-10 04:10:10 -0700</bug_when>
    <thetext>Comment on attachment 103461
Added resetAnimation() fuction call in order to restart animation 

Attachment 103461 did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9339590

New failing tests:
http/tests/inspector/console-resource-errors.html
http/tests/inspector/network/disabled-cache-crash.html
http/tests/inspector/console-xhr-logging.html
http/tests/inspector/network/network-cachedresources-with-same-urls.html
http/tests/inspector/console-cd.html
http/tests/inspector/change-iframe-src.html
http/tests/inspector/console-cd-completions.html
http/tests/inspector/resource-har-headers.html
http/tests/inspector/network/download.html
http/tests/inspector-enabled/console-clear-arguments-on-frame-remove.html
http/tests/inspector/inspect-iframe-from-different-domain.html
http/tests/inspector-enabled/console-log-before-frame-navigation.html
animations/animation-add-events-in-handler.html
http/tests/inspector/network-preflight-options.html
http/tests/inspector-enabled/dom-storage-open.html
http/tests/inspector/resource-har-conversion.html
http/tests/inspector/console-websocket-error.html
http/tests/inspector/resource-parameters.html
http/tests/inspector-enabled/database-open.html
http/tests/inspector/network/network-clear-after-disabled.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>449236</commentid>
    <comment_count>4</comment_count>
      <attachid>103461</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-08-10 10:49:51 -0700</bug_when>
    <thetext>Comment on attachment 103461
Added resetAnimation() fuction call in order to restart animation 

View in context: https://bugs.webkit.org/attachment.cgi?id=103461&amp;action=review

Does this change the current animation behavior of dynamically inserting a second copy of an image into a page that already contains one copy?  (I don&apos;t remember whether that resets animation or not, but whichever way it goes is intentional.)

&gt; Source/WebCore/html/HTMLImageElement.cpp:220
&gt;          m_imageLoader.updateFromElement();

Does this guarantee that the line below will not deref NULL?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>449646</commentid>
    <comment_count>5</comment_count>
    <who name="Swapna P">vswap65</who>
    <bug_when>2011-08-11 00:36:24 -0700</bug_when>
    <thetext>Hi Peter,

It doesn&apos;t change the current animation behavior.
In resetAnimation() function , only the animation values are getting reset.
So it doesn&apos;t deref NULL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>449647</commentid>
    <comment_count>6</comment_count>
    <who name="Swapna P">vswap65</who>
    <bug_when>2011-08-11 00:47:27 -0700</bug_when>
    <thetext>Hi Peter,

If the above comment satisfies you, let me know. I will upload the patch along with the testcases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>449960</commentid>
    <comment_count>7</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-08-11 13:02:21 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; It doesn&apos;t change the current animation behavior.

So, the current behavior is that adding a second copy of the image to the page resets the first and causes both to animate from the beginning?

&gt; In resetAnimation() function , only the animation values are getting reset.
&gt; So it doesn&apos;t deref NULL.

? This doesn&apos;t answer my question.  Right above the call you added we handle the case of m_imageLoader.image() returning NULL.  Then your new code promptly derefs that pointer blindly, along with the pointer it returns.  I want to know if that&apos;s safe.  That has nothing to do with what resetAnimation() does.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>450311</commentid>
    <comment_count>8</comment_count>
    <who name="Swapna P">vswap65</who>
    <bug_when>2011-08-11 23:31:58 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #5)
&gt; &gt; It doesn&apos;t change the current animation behavior.
&gt; 
&gt; So, the current behavior is that adding a second copy of the image to the page resets the first and causes both to animate from the beginning?

Yes, the current behavior (with my patch) would be the same as you explained above i.e. adding a second copy of the image to the page will reset the first &amp; both will start animation from the beginning.
&gt; 
&gt; &gt; In resetAnimation() function , only the animation values are getting reset.
&gt; &gt; So it doesn&apos;t deref NULL.
&gt; 
&gt; ? This doesn&apos;t answer my question.  Right above the call you added we handle the case of m_imageLoader.image() returning NULL.  Then your new code promptly derefs that pointer blindly, along with the pointer it returns.  I want to know if that&apos;s safe.  That has nothing to do with what resetAnimation() does.

I now understand your question. if m_imageLoader.image() is NULL, m_imageLoader.updateFromElement() populates the m_imageLoader.image(). Therefore the code we have added is safe.

Still to be absolutely sure, we can add NULL check before our code also. It will not affect the functionality</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>450492</commentid>
    <comment_count>9</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-08-12 10:28:51 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; (In reply to comment #5)
&gt; &gt; &gt; In resetAnimation() function , only the animation values are getting reset.
&gt; &gt; &gt; So it doesn&apos;t deref NULL.
&gt; &gt; 
&gt; &gt; ? This doesn&apos;t answer my question.  Right above the call you added we handle the case of m_imageLoader.image() returning NULL.  Then your new code promptly derefs that pointer blindly, along with the pointer it returns.  I want to know if that&apos;s safe.  That has nothing to do with what resetAnimation() does.
&gt; 
&gt; I now understand your question. if m_imageLoader.image() is NULL, m_imageLoader.updateFromElement() populates the m_imageLoader.image(). Therefore the code we have added is safe.

And when m_imageLoader.image() is non-NULL, m_imageLoader.image().image() is guaranteed to be non-NULL?

&gt; Still to be absolutely sure, we can add NULL check before our code also. It will not affect the functionality

If this really cannot be NULL, we should assert (or do nothing), rather than implying it can be NULL by adding a conditional.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451529</commentid>
    <comment_count>10</comment_count>
    <who name="Swapna P">vswap65</who>
    <bug_when>2011-08-16 02:08:18 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #8)
&gt; &gt; (In reply to comment #7)
&gt; &gt; &gt; (In reply to comment #5)
&gt; &gt; &gt; &gt; In resetAnimation() function , only the animation values are getting reset.
&gt; &gt; &gt; &gt; So it doesn&apos;t deref NULL.
&gt; &gt; &gt; 
&gt; &gt; &gt; ? This doesn&apos;t answer my question.  Right above the call you added we handle the case of m_imageLoader.image() returning NULL.  Then your new code promptly derefs that pointer blindly, along with the pointer it returns.  I want to know if that&apos;s safe.  That has nothing to do with what resetAnimation() does.
&gt; &gt; 
&gt; &gt; I now understand your question. if m_imageLoader.image() is NULL, m_imageLoader.updateFromElement() populates the m_imageLoader.image(). Therefore the code we have added is safe.
&gt; 
&gt; And when m_imageLoader.image() is non-NULL, m_imageLoader.image().image() is guaranteed to be non-NULL?

Yes, correct. m_imageLoader.image().image() is never NULL.
&gt; 
&gt; &gt; Still to be absolutely sure, we can add NULL check before our code also. It will not affect the functionality
&gt; 
&gt; If this really cannot be NULL, we should assert (or do nothing), rather than implying it can be NULL by adding a conditional.

Therefore, we will do nothing before executing resetAnimation() [no NULL checking required]

Also, I have one more doubt regarding test cases. I saw few test cases failing for Cr-linux though they did not seem to be related to my changes. Do you have any idea what could be the reason? 

And Do i need to add any test cases for my change? Because the expected behavior here is to see all the images animating (visual changes) so I was not sure how to write a test cases for my changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451734</commentid>
    <comment_count>11</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-08-16 10:51:49 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; Also, I have one more doubt regarding test cases. I saw few test cases failing for Cr-linux though they did not seem to be related to my changes. Do you have any idea what could be the reason? 

No.

&gt; And Do i need to add any test cases for my change? Because the expected behavior here is to see all the images animating (visual changes) so I was not sure how to write a test cases for my changes.

I&apos;m not totally sure either.  A simple pixel test is going to show the image sitting on its final frame both with and without your patch.  Perhaps your reviewer will have an idea I don&apos;t.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>453704</commentid>
    <comment_count>12</comment_count>
    <who name="Swapna P">vswap65</who>
    <bug_when>2011-08-19 01:49:42 -0700</bug_when>
    <thetext>Hi Peter, thank you for your comments.

Can any one review the patch, and let me know if any further changes needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473905</commentid>
    <comment_count>13</comment_count>
      <attachid>108837</attachid>
    <who name="Ravi Phaneendra Kasibhatla">ravi.kasibhatla</who>
    <bug_when>2011-09-27 06:32:18 -0700</bug_when>
    <thetext>Created attachment 108837
Fix for GIF not animating on dynamic detach &amp; attach

pkasting: Attached is a patch which fixes the issue. 
Patch ensures that any detach of the image element from the DOM also ensures the image associated with the element (CachedResourceClient) is unregistered with the CachedResource which was created while loading the image element. If the CachedResource is not being referenced by any other client it is purged. So, when the image element is reattached, it becomes new client which is registered with the CachedResource and animation state is reset for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473918</commentid>
    <comment_count>14</comment_count>
      <attachid>108837</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-09-27 07:02:35 -0700</bug_when>
    <thetext>Comment on attachment 108837
Fix for GIF not animating on dynamic detach &amp; attach

Attachment 108837 did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9878337

New failing tests:
platform/mac/editing/deleting/deletionUI-differing-background.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>473977</commentid>
    <comment_count>15</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-09-27 09:20:06 -0700</bug_when>
    <thetext>(In reply to comment #13)
&gt; Patch ensures that any detach of the image element from the DOM also ensures the image associated with the element (CachedResourceClient) is unregistered with the CachedResource which was created while loading the image element.

My instinct is that this is a more correct fix.  Unfortunately I don&apos;t understand too much about how resource loading and caching actually works so I can&apos;t say for sure (and I&apos;m not a reviewer anyway).  You might want to ask whomever worked on CachedImage?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>474074</commentid>
    <comment_count>16</comment_count>
    <who name="Ravi Phaneendra Kasibhatla">ravi.kasibhatla</who>
    <bug_when>2011-09-27 10:55:24 -0700</bug_when>
    <thetext>Hi Nate,
Can you please review the attached patch (https://bugs.webkit.org/attachment.cgi?id=108837) and let me know your comments if any?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>474095</commentid>
    <comment_count>17</comment_count>
      <attachid>108837</attachid>
    <who name="Nate Chapin">japhet</who>
    <bug_when>2011-09-27 11:14:44 -0700</bug_when>
    <thetext>Comment on attachment 108837
Fix for GIF not animating on dynamic detach &amp; attach

View in context: https://bugs.webkit.org/attachment.cgi?id=108837&amp;action=review

Antti knows the CachedResource&lt;-&gt;CachedResourceClient interface better than I do, so I cc:ed him.  One comment inline, though.

&gt; Source/WebCore/html/HTMLImageElement.cpp:225
&gt;  
&gt; +    // Unregister with CachedImage when removing image element from DOM to ensure CachedImage is not holding dead references.
&gt; +    if (m_imageLoader.image())
&gt; +        m_imageLoader.image()-&gt;removeClient(&amp;m_imageLoader);
&gt; +

Currently, ImageLoader only calls CachedImage::removeClient() when it clears its pointer to the CachedImage.  Since ImageLoader holds a CachedResourceHandle&lt;CachedImage&gt; rather than a raw CachedImage*, this patch as written will cause the CachedImage to be keep alive by an object that can&apos;t receive its callbacks.

I don&apos;t think that&apos;s desirable, but maybe I&apos;m missing something.  This should probably just be:
m_imageLoader.setImage(0);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>474527</commentid>
    <comment_count>18</comment_count>
    <who name="Swapna">spottabathini</who>
    <bug_when>2011-09-27 23:27:18 -0700</bug_when>
    <thetext>&gt; Source/WebCore/html/HTMLImageElement.cpp:225
&gt;  
&gt; +    // Unregister with CachedImage when removing image element from DOM to ensure CachedImage is not holding dead references.
&gt; +    if (m_imageLoader.image())
&gt; +        m_imageLoader.image()-&gt;removeClient(&amp;m_imageLoader);
&gt; +


Hi , this is Swapna. I submitted patch earlier with gmail id &quot;vswap65@gmail.com&quot;

While I tested the  test case with above changes,  I am still able to see the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>474690</commentid>
    <comment_count>19</comment_count>
      <attachid>109010</attachid>
    <who name="Ravi Phaneendra Kasibhatla">ravi.kasibhatla</who>
    <bug_when>2011-09-28 05:54:25 -0700</bug_when>
    <thetext>Created attachment 109010
Fix for GIF not animating on dynamic detach &amp; attach - revision 2

Addressing the comment from Nate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>474694</commentid>
    <comment_count>20</comment_count>
    <who name="Ravi Phaneendra Kasibhatla">ravi.kasibhatla</who>
    <bug_when>2011-09-28 05:58:03 -0700</bug_when>
    <thetext>(In reply to comment #18)
&gt; &gt; Source/WebCore/html/HTMLImageElement.cpp:225
&gt; &gt;  
&gt; &gt; +    // Unregister with CachedImage when removing image element from DOM to ensure CachedImage is not holding dead references.
&gt; &gt; +    if (m_imageLoader.image())
&gt; &gt; +        m_imageLoader.image()-&gt;removeClient(&amp;m_imageLoader);
&gt; &gt; +
&gt; 
&gt; 
&gt; Hi , this is Swapna. I submitted patch earlier with gmail id &quot;vswap65@gmail.com&quot;
&gt; 
&gt; While I tested the  test case with above changes,  I am still able to see the issue.

Hi Swapna,
I have verified the previous patch &amp; current patch on Chromium &amp; GTK ports (on linux) and it is working. Ran layout tests also to ensure no regression with the patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>474717</commentid>
    <comment_count>21</comment_count>
    <who name="Swapna">spottabathini</who>
    <bug_when>2011-09-28 06:42:48 -0700</bug_when>
    <thetext>Hi ,

I tested on windows webkit with winlauncer set up with the above patch , for some reason I don&apos;t see it working.
Did any one tested on the same environment?
If I click on play continuously it is showing animation for some extent . But after that , it is not animating for click events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475460</commentid>
    <comment_count>22</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2011-09-29 09:33:27 -0700</bug_when>
    <thetext>Who sets the m_imageLoader back if the same element is re-added to a document? Can this cause us reload the image in that case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475472</commentid>
    <comment_count>23</comment_count>
      <attachid>109010</attachid>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2011-09-29 09:46:54 -0700</bug_when>
    <thetext>Comment on attachment 109010
Fix for GIF not animating on dynamic detach &amp; attach - revision 2

I suspect this can trigger network reload of the image if the element is re-added to the document (in case it is expired, has no-store, etc). I don&apos;t see why bug about restarting animation needs a change with such a broad potential side effects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475495</commentid>
    <comment_count>24</comment_count>
    <who name="Mustafizur Rahaman( :rahaman)">mrahaman</who>
    <bug_when>2011-09-29 10:07:10 -0700</bug_when>
    <thetext>Hi Antti Koivisto, 

Could you also please review the patch uploaded by Swapna (vswap65) where we are doing resetting the animation? We had verified that the fix is solving the issue for Windows build.

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475505</commentid>
    <comment_count>25</comment_count>
      <attachid>109010</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-09-29 10:24:54 -0700</bug_when>
    <thetext>Comment on attachment 109010
Fix for GIF not animating on dynamic detach &amp; attach - revision 2

(In reply to comment #23)
&gt; (From update of attachment 109010 [details])
&gt; I suspect this can trigger network reload of the image if the element is re-added to the document (in case it is expired, has no-store, etc). I don&apos;t see why bug about restarting animation needs a change with such a broad potential side effects.

Actually I think this is precisely the correct behavior.  When the image is removed from the document, it should really be removed; any caches should not still hang onto it.  If when re-added later that means we have to redownload it that&apos;s perfectly fine.

I think you should rethink your opposition to this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475506</commentid>
    <comment_count>26</comment_count>
      <attachid>103461</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-09-29 10:25:48 -0700</bug_when>
    <thetext>Comment on attachment 103461
Added resetAnimation() fuction call in order to restart animation 

I am convinced this patch is wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475508</commentid>
    <comment_count>27</comment_count>
    <who name="Mustafizur Rahaman( :rahaman)">mrahaman</who>
    <bug_when>2011-09-29 10:31:44 -0700</bug_when>
    <thetext>(In reply to comment #26)
&gt; (From update of attachment 103461 [details])
&gt; I am convinced this patch is wrong.

Hi Peter,

When Swapna uploaded the patch, there were few follow-up discussion regarding your comments and she tried to answer all of your queries. So, may be we missed to realize that the fix was not proper but it would certainly help from our knowledge point of view that in what aspect, you think the patch is wrong?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475509</commentid>
    <comment_count>28</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-09-29 10:33:42 -0700</bug_when>
    <thetext>(In reply to comment #27)
&gt; in what aspect, you think the patch is wrong?

The fact that something like the other patch is the right way to go.  That patch makes it clear that we were not re-animating because we were not fully dropping everyone&apos;s references to the image.  We should be.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475618</commentid>
    <comment_count>29</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2011-09-29 12:48:38 -0700</bug_when>
    <thetext>(In reply to comment #25)
&gt; Actually I think this is precisely the correct behavior.  When the image is removed from the document, it should really be removed; any caches should not still hang onto it.  If when re-added later that means we have to redownload it that&apos;s perfectly fine.

Why?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475704</commentid>
    <comment_count>30</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-09-29 15:01:08 -0700</bug_when>
    <thetext>(In reply to comment #29)
&gt; (In reply to comment #25)
&gt; &gt; Actually I think this is precisely the correct behavior.  When the image is removed from the document, it should really be removed; any caches should not still hang onto it.  If when re-added later that means we have to redownload it that&apos;s perfectly fine.
&gt; 
&gt; Why?

Which part are you asking why about?

The reason I think we should drop all references when removing an image from a document is that otherwise they act sort of like we&apos;re leaking them -- we aren&apos;t displaying the image anymore but we&apos;re still keeping data about it alive.

Re-adding an image to a document later does not seem qualitatively different to me than some other way of adding it, e.g. if the document simply waited ten seconds after load and then dynamically added an image.  In that case the image would clearly be subject to loading off the network etc.

The desired behavior here seems like a symptom of the fact that we want browsers to treat these sorts of dynamic re-additions consistently with other additions, and achieving it by ensuring no data structures outlive the original removal seems like the right theoretical behavior that also has the right practical effect here, as opposed to a narrowly-targeted patch to just implement re-animation, which is more of a hack.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475930</commentid>
    <comment_count>31</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2011-09-29 23:46:28 -0700</bug_when>
    <thetext>(In reply to comment #30)

&gt; The reason I think we should drop all references when removing an image from a document is that otherwise they act sort of like we&apos;re leaking them -- we aren&apos;t displaying the image anymore but we&apos;re still keeping data about it alive.

If the HTMLImageElement is staying alive after being removed from he tree then most likely a Javascript wrapper is holding a reference to it. In that case (ignoring gc delay) there is a decent chance that it will get reattached. I see no obvious reason to dump the cached data while it is outside of the tree.

Word &quot;leak&quot; has specific meaning which does not apply here.

&gt; Re-adding an image to a document later does not seem qualitatively different to me than some other way of adding it, e.g. if the document simply waited ten seconds after load and then dynamically added an image.  In that case the image would clearly be subject to loading off the network etc.

Moving an item seems qualitatively different to creating an item to me.

&gt; The desired behavior here seems like a symptom of the fact that we want browsers to treat these sorts of dynamic re-additions consistently with other additions, and achieving it by ensuring no data structures outlive the original removal seems like the right theoretical behavior that also has the right practical effect here, as opposed to a narrowly-targeted patch to just implement re-animation, which is more of a hack.

I&apos;m not convinced by this theory. What do other engines do?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475943</commentid>
    <comment_count>32</comment_count>
    <who name="Mustafizur Rahaman( :rahaman)">mrahaman</who>
    <bug_when>2011-09-30 00:02:25 -0700</bug_when>
    <thetext>Is it also worth to investigate as why this patch is not solving the issue for windows port?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>476000</commentid>
    <comment_count>33</comment_count>
    <who name="Swapna">spottabathini</who>
    <bug_when>2011-09-30 03:09:10 -0700</bug_when>
    <thetext>@@ -219,6 +219,10 @@ void HTMLImageElement::removedFromDocument()
         document-&gt;removeExtraNamedItem(m_id);
     }
 
+    // Unregister with CachedImage when removing image element from DOM to ensure CachedImage is not holding dead references.
+    if (m_imageLoader.image())
+        m_imageLoader.setImage(0);
+

I have tried setting up GTK build and verified with above changes, behaviour on GTK Linux is same as Windows environment. i.e,Image stops animating immediately after few clicks.
Patch proposed by me is actually solving the issue on both Win &amp; GTK ports, i will try to enhance the same considering Resource Leaks from the above conversation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>476352</commentid>
    <comment_count>34</comment_count>
      <attachid>109358</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-09-30 15:42:41 -0700</bug_when>
    <thetext>Created attachment 109358
Second testcase

(In reply to comment #31)
&gt; (In reply to comment #30)
&gt; &gt; The desired behavior here seems like a symptom of the fact that we want browsers to treat these sorts of dynamic re-additions consistently with other additions, and achieving it by ensuring no data structures outlive the original removal seems like the right theoretical behavior that also has the right practical effect here, as opposed to a narrowly-targeted patch to just implement re-animation, which is more of a hack.
&gt; 
&gt; I&apos;m not convinced by this theory. What do other engines do?

I&apos;ve attached a second testcase that is useful for understanding this.  I tested the behavior five ways, and drew conclusions based on those as well as the fact that all engines re-animate the original testcase on hitting play:
(1) With the stock testcase.  This differs from the original in two ways.  First, we have an &lt;img&gt; element pointing to the same src, to test how image objects and elements that point to the same src are linked.  Second, we don&apos;t recreate the image object -- we simply dynamically add and remove it from the document.
(2) Removing the &lt;img&gt; element from the testcase, leaving only the image object.  This tests how a single object behaves when dynamically removed and re-added.
(3) Restoring the &lt;img&gt; element but changing the image object to be recreated on each call to run() (like the first testcase did).  This tests whether dropping the old image object ref is meaningful in the presence of a long-lived &lt;img&gt;.
(4) Moving the &quot;var img&quot; declaration entirely into run() and making done() do nothing, so we continually append new image objects.
(5) Removing the appendChild() call in run(), so it merely creates new image objects, but doesn&apos;t display them.  This tests whether object creation or addition to the DOM is what resets animation state.

Firefox, IE, and Opera disagree about most things here, except that they all animate all images on load.

Firefox:
(1) Nothing animates on hitting play.
(2) Nothing animates on hitting play.
(3) Both images re-animate every time you hit play.
(4) Each time you hit play, there is a new image, and all the images re-animate.
(5) Each time you hit play, the image re-animates.
Conclusion: The animation states of all the &lt;img&gt; elements and image objects with the same src attributes are linked.  This linked animation state is reset each time a new image object is created.  Addition to the DOM or destruction of old objects are both irrelevant, it&apos;s object creation that resets state.

IE:
(1) The image object animates on hitting play, but the &lt;img&gt; element does not.
(2) The image object animates on hitting play.
(3) Nothing animates on hitting play.
(4) Nothing animates on hitting play.
(5) Nothing animates on hitting play.
Conclusion: This behavior makes no sense.  Result (1) suggests that animation states for objects versus elements are tracked separately, yet result (3) (which differs from the original testcase only by the presence of an &lt;img&gt; element) suggests that they are linked together.  I cannot come up with an explanation for how this behavior is possible.

Opera:
(1) Nothing animates on hitting play.
(2) The image object animates on hitting play.
(3) Nothing animates on hitting play.
(4) Nothing animates on hitting play.
(5) Nothing animates on hitting play.
Conclusion: The animation states of all the &lt;img&gt; elements and image objects with the same src attributes are linked.  This linked animation state is reset when we add an object to the DOM, but only if there are no other linked objects in the DOM already.

Firefox and Opera both arguably make some sense.  I would probably prefer to adopt the Firefox behavior.  If we want to do that, we&apos;ll need to make some changes to our animation code.  Further testing confirms that if you create a brand new animated image object (to a src that no other object or element has), then wait, and only later add it to the DOM, Firefox begins animating it on creation, so on the later addition, the image appears midway through its animation.  In WebKit I believe we don&apos;t trigger animation to start until we first draw() the image.  This would have to change to instead start animation on object creation.  I _think_ the &quot;image invisible, skip frames&quot; logic in BitmapImage.cpp would mean this wouldn&apos;t have any CPU load effects, it would merely make the animation start timing be set at load instead of when first drawing, so this change would be feasible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>476354</commentid>
    <comment_count>35</comment_count>
      <attachid>109359</attachid>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-09-30 15:43:25 -0700</bug_when>
    <thetext>Created attachment 109359
Real second testcase

Oops, attached wrong file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>484801</commentid>
    <comment_count>36</comment_count>
    <who name="Kishore Bolisetty">kbolisetty</who>
    <bug_when>2011-10-16 12:30:39 -0700</bug_when>
    <thetext>Hi All, the above comparison and conclusions on different browser’s is quite useful. Based on the above note and some more testing, I am sharing my observations.
In WebKit also, all the resources with same src attributes are linked. Infact this is what is the CachedResource we get from docloader after cache validation.
I tried to create/append a non-animating image with same src attribute. I could clearly see the images getting appended to the document. Infact I could see the animating Image also getting appended properly to the document. But Since it is a cached Image (cached animating image) and it is already done with the animation, renderer find 0 pending frames of the animation image to paint, and hence nothing is painted except for the first time. 
I tried the following algorithm:
1. Check if the Resource being attached to DOM Tree is a cachedResource.
2. If it is a cached resource, check if it is animation Image. ( Image framecount&gt;1 only for animation Image. So I used this to find if it’s a animating image or not) 
3. If it is a cached animating Image, only then reset the animation.
If this is making sense, I can provide the patch based on the above Algo.
Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>484883</commentid>
    <comment_count>37</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-10-16 19:37:53 -0700</bug_when>
    <thetext>That proposal wouldn&apos;t make us match Gecko.  If I understand correctly it would affect animation at the time of DOM attachment rather than image object creation; and it also wouldn&apos;t change the timings as described at the very end of comment 34.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485022</commentid>
    <comment_count>38</comment_count>
    <who name="Kishore Bolisetty">kbolisetty</who>
    <bug_when>2011-10-17 02:46:33 -0700</bug_when>
    <thetext>(In reply to comment #37)
&gt; That proposal wouldn&apos;t make us match Gecko.  If I understand correctly it would affect animation at the time of DOM attachment rather than image object creation; and it also wouldn&apos;t change the timings as described at the very end of comment 34.

The Proposal Actually is in Sync with Gecko(for restting animation), but little deviation that favours toward webkit rendering approach.
#1&gt; I am resetting the animation during object creation. I mean when src attribute is initialized.
#2&gt; As you know, WebKit engine will actually start the animation while rendering and not at the time of object creation.

Even though, FireFox is resetting and starting animation at the time of Image creation, but I am in favour of WebKit behaviour as mentioned in #2 above(ie., starting animation while rendering), because there is no point in starting animation when the created image is never attached to DOM. 


Here is the svn diff of my proposal:
$ svn diff Source/WebCore/loader/ImageLoader.cpp
Index: Source/WebCore/loader/ImageLoader.cpp
===================================================================
--- Source/WebCore/loader/ImageLoader.cpp       (revision 97439)
+++ Source/WebCore/loader/ImageLoader.cpp       (working copy)
@@ -218,6 +218,12 @@

     if (RenderImageResource* imageResource = renderImageResource())
         imageResource-&gt;resetAnimation();
+
+       // TODO:: Kishore To Check if this should be done before Resource Load T
rigger from Memory Cache.
+       // TODO:: CachedResourceLoader::requestResource() -&gt; USE -&gt; notifyLoaded
FromMemoryCache(resource)
+       if(newImage-&gt;status() == CachedResource::Cached &amp;&amp; newImage-&gt;image()-&gt;is
AnimationImage()) {
+                       newImage-&gt;image()-&gt;resetAnimation();
+       }
 }

 void ImageLoader::updateFromElementIgnoringPreviousError()

kbolisetty@IM-LP-093 ~/WebKit
$ svn diff Surce/WebCore/platform/graphics/Image.h
Index: Source/WebCore/platform/graphics/Image.h
===================================================================
--- Source/WebCore/platform/graphics/Image.h    (revision 97439)
+++ Source/WebCore/platform/graphics/Image.h    (working copy)
@@ -124,6 +124,7 @@
     virtual void startAnimation(bool /*catchUpIfNecessary*/ = true) { }
     virtual void stopAnimation() {}
     virtual void resetAnimation() {}
+       virtual bool isAnimationImage() const {return false;}

     // Typically the CachedImage that owns us.
     ImageObserver* imageObserver() const { return m_imageObserver; }

kbolisetty@IM-LP-093 ~/WebKit
$ svn diff Source/WebCore/platform/graphics/BitmapImage.h
Index: Source/WebCore/platform/graphics/BitmapImage.h
===================================================================
--- Source/WebCore/platform/graphics/BitmapImage.h      (revision 97439)
+++ Source/WebCore/platform/graphics/BitmapImage.h      (working copy)
@@ -126,7 +126,7 @@
     // automatically pause once all observers no longer want to render the imag
e anywhere.
     virtual void stopAnimation();
     virtual void resetAnimation();
-
+    virtual bool isAnimationImage() const { return (m_frameCount&gt;1)?true:false;
}
     virtual unsigned decodedSize() const { return m_decodedSize; }

 #if PLATFORM(MAC)

kbolisetty@IM-LP-093 ~/WebKit</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485262</commentid>
    <comment_count>39</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-10-17 10:41:56 -0700</bug_when>
    <thetext>(In reply to comment #38)
&gt; Even though, FireFox is resetting and starting animation at the time of Image creation, but I am in favour of WebKit behaviour as mentioned in #2 above(ie., starting animation while rendering), because there is no point in starting animation when the created image is never attached to DOM. 

Yes there is; to keep timings synced between different images.  For example, if you want to dynamically swap animated images for each other and have them be at the same point in the animation stream, this is useful.

Note that we won&apos;t actually animate the image while it&apos;s detached, we&apos;d just want to set the start time of the animation correctly.  That will make us spin forward the animation by the right amount when we finally do draw the image.

&gt; Here is the svn diff of my proposal:

Please don&apos;t put diffs inline.  If you want to show people a diff attach it to the bug as a patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>485265</commentid>
    <comment_count>40</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-10-17 10:44:24 -0700</bug_when>
    <thetext>(In reply to comment #39)
&gt; (In reply to comment #38)
&gt; &gt; Even though, FireFox is resetting and starting animation at the time of Image creation, but I am in favour of WebKit behaviour as mentioned in #2 above(ie., starting animation while rendering), because there is no point in starting animation when the created image is never attached to DOM. 
&gt; 
&gt; Yes there is; to keep timings synced between different images.

And, of course: to match Gecko.

We want browser behaviors to converge to a single common behavior so that authors can write something once and have it work everywhere.  Gratuitously differing from other rendering engines doesn&apos;t advance this goal.  The point of documenting other engines&apos; behavior was to try and pick a behavior that matched at least one, not to leave us in a state where we don&apos;t match anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>486881</commentid>
    <comment_count>41</comment_count>
    <who name="Peter Kasting">pkasting</who>
    <bug_when>2011-10-19 10:45:14 -0700</bug_when>
    <thetext>I don&apos;t know whether fixing https://bugzilla.mozilla.org/show_bug.cgi?id=573583 has affected Firefox&apos; behavior.  Someone might want to retry with a trunk build to see.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>532513</commentid>
    <comment_count>42</comment_count>
      <attachid>109010</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-01-09 14:02:07 -0800</bug_when>
    <thetext>Comment on attachment 109010
Fix for GIF not animating on dynamic detach &amp; attach - revision 2

Seems like this only fixes the issue if there is only one copy of the gif on the page.  If there is more than one copy and we only remove/re-add one of them, then that one will still not reset.  Is that expected behavior?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>545136</commentid>
    <comment_count>43</comment_count>
    <who name="Pierre Rudloff">rudloff</who>
    <bug_when>2012-01-30 08:50:11 -0800</bug_when>
    <thetext>The same problem appears with animated SVG. Should I fill a new bug ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>545564</commentid>
    <comment_count>44</comment_count>
      <attachid>109010</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2012-01-30 16:21:13 -0800</bug_when>
    <thetext>Comment on attachment 109010
Fix for GIF not animating on dynamic detach &amp; attach - revision 2

Need an answer to my question about multiple copies of the same gif on the page (and if we care about that case).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2186647</commentid>
    <comment_count>45</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-03-03 12:03:43 -0800</bug_when>
    <thetext>&lt;rdar://problem/171648233&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>32681</attachid>
            <date>2009-07-13 14:53:34 -0700</date>
            <delta_ts>2009-07-13 14:53:34 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>297</size>
            <attacher name="Peter Kasting">pkasting</attacher>
            
              <data encoding="base64">PHNjcmlwdD4KdmFyIGltZzsKZnVuY3Rpb24gcnVuKCkgewogIGltZyA9IG5ldyBJbWFnZSgpOwog
IGltZy5zcmMgPSAiaHR0cDovL3d3dy5nb29nbGUuY29tL2ltYWdlcy9zd3hhLmdpZiI7CiAgZG9j
dW1lbnQuYm9keS5hcHBlbmRDaGlsZChpbWcpOwogIHdpbmRvdy5zZXRUaW1lb3V0KGRvbmUsIDc1
MCk7Cn0KZnVuY3Rpb24gZG9uZSgpIHsKICBkb2N1bWVudC5ib2R5LnJlbW92ZUNoaWxkKGltZyk7
Cn0KPC9zY3JpcHQ+CjxpbnB1dCB0eXBlPWJ1dHRvbiB2YWx1ZT1QbGF5IG9uY2xpY2s9InJ1bigp
Ij4KPGJyPjxicj4K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>103461</attachid>
            <date>2011-08-10 03:56:29 -0700</date>
            <delta_ts>2011-09-29 10:25:48 -0700</delta_ts>
            <desc>Added resetAnimation() fuction call in order to restart animation </desc>
            <filename>Propose_Patch_27238</filename>
            <type>text/plain</type>
            <size>1260</size>
            <attacher name="Swapna P">vswap65</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT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09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9XZWJDb3Jl
L2h0bWwvSFRNTEltYWdlRWxlbWVudC5jcHAJKHJldmlzaW9uIDkwNTU1KQorKysgU291cmNlL1dl
YkNvcmUvaHRtbC9IVE1MSW1hZ2VFbGVtZW50LmNwcAkod29ya2luZyBjb3B5KQpAQCAtMjE5LDYg
KzIxOSw4IEBAIHZvaWQgSFRNTEltYWdlRWxlbWVudDo6aW5zZXJ0ZWRJbnRvRG9jdW0KICAgICBp
ZiAoIW1faW1hZ2VMb2FkZXIuaW1hZ2UoKSkKICAgICAgICAgbV9pbWFnZUxvYWRlci51cGRhdGVG
cm9tRWxlbWVudCgpOwogCisgICAgbV9pbWFnZUxvYWRlci5pbWFnZSgpLT5pbWFnZSgpLT5yZXNl
dEFuaW1hdGlvbigpOworCiAgICAgSFRNTEVsZW1lbnQ6Omluc2VydGVkSW50b0RvY3VtZW50KCk7
CiB9CiAK
</data>
<flag name="review"
          id="99079"
          type_id="1"
          status="-"
          setter="pkasting"
    />
    <flag name="commit-queue"
          id="99080"
          type_id="3"
          status="-"
          setter="webkit.review.bot"
    />
          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>108837</attachid>
            <date>2011-09-27 06:32:18 -0700</date>
            <delta_ts>2011-09-28 05:54:25 -0700</delta_ts>
            <desc>Fix for GIF not animating on dynamic detach &amp; attach</desc>
            <filename>27238_fix_rev1.diff</filename>
            <type>text/plain</type>
            <size>1770</size>
            <attacher name="Ravi Phaneendra Kasibhatla">ravi.kasibhatla</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAwMDIzOGU1Li4wNDBhN2FkIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL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yKTsKKwogICAgIEhUTUxFbGVtZW50OjpyZW1vdmVkRnJvbURvY3VtZW50KCk7CiB9
CiAK
</data>
<flag name="commit-queue"
          id="105904"
          type_id="3"
          status="-"
          setter="webkit.review.bot"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>109010</attachid>
            <date>2011-09-28 05:54:25 -0700</date>
            <delta_ts>2012-01-30 16:21:13 -0800</delta_ts>
            <desc>Fix for GIF not animating on dynamic detach &amp; attach - revision 2</desc>
            <filename>27238_fix_rev2.diff</filename>
            <type>text/plain</type>
            <size>1744</size>
            <attacher name="Ravi Phaneendra Kasibhatla">ravi.kasibhatla</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAwMDIzOGU1Li4wNDBhN2FkIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTkg
QEAKKzIwMTEtMDktMjcgIFJhdmkgUGhhbmVlbmRyYSBLYXNpYmhhdGxhICA8cmF2aS5rYXNpYmhh
dGxhQG1vdG9yb2xhLmNvbT4KKworICAgICAgICBBbmltYXRlZCBHSUYgZHluYW1pY2FsbHkgcmVt
b3ZlZCBhbmQgcmVhZGRlZCB0byBwYWdlIGRvZXMgbm90IHJlLWFuaW1hdGUKKyAgICAgICAgaHR0
cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTI3MjM4CisKKyAgICAgICAgUmV2
aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgV2hlbiBhIGltYWdlIGVsZW1lbnQg
YmVpbmcgcmVtb3ZlZCBmcm9tIHRoZSBET00sIHRoZW4gaXQgc2hvdWxkIGJlIHVucm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jZS9XZWJDb3JlL2h0bWwv
SFRNTEltYWdlRWxlbWVudC5jcHAKKysrIGIvU291cmNlL1dlYkNvcmUvaHRtbC9IVE1MSW1hZ2VF
bGVtZW50LmNwcApAQCAtMjE5LDYgKzIxOSwxMCBAQCB2b2lkIEhUTUxJbWFnZUVsZW1lbnQ6OnJl
bW92ZWRGcm9tRG9jdW1lbnQoKQogICAgICAgICBkb2N1bWVudC0+cmVtb3ZlRXh0cmFOYW1lZEl0
ZW0obV9pZCk7CiAgICAgfQogCisgICAgLy8gVW5yZWdpc3RlciB3aXRoIENhY2hlZEltYWdlIHdo
ZW4gcmVtb3ZpbmcgaW1hZ2UgZWxlbWVudCBmcm9tIERPTSB0byBlbnN1cmUgQ2FjaGVkSW1hZ2Ug
aXMgbm90IGhvbGRpbmcgZGVhZCByZWZlcmVuY2VzLgorICAgIGlmIChtX2ltYWdlTG9hZGVyLmlt
YWdlKCkpCisgICAgICAgIG1faW1hZ2VMb2FkZXIuc2V0SW1hZ2UoMCk7CisKICAgICBIVE1MRWxl
bWVudDo6cmVtb3ZlZEZyb21Eb2N1bWVudCgpOwogfQogCg==
</data>
<flag name="review"
          id="106129"
          type_id="1"
          status="-"
          setter="eric"
    />
          </attachment>
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>109358</attachid>
            <date>2011-09-30 15:42:41 -0700</date>
            <delta_ts>2011-09-30 15:43:25 -0700</delta_ts>
            <desc>Second testcase</desc>
            <filename>foo.html</filename>
            <type>text/html</type>
            <size>318</size>
            <attacher name="Peter Kasting">pkasting</attacher>
            
              <data encoding="base64">PHNjcmlwdD4NCiAgICB2YXIgaW1nOw0KZnVuY3Rpb24gcnVuKCkgew0KICAgIGltZyA9IG5ldyBJ
bWFnZSgpOw0KICAgIGltZy5zcmMgPSAiaHR0cDovL3d3dy5nb29nbGUuY29tL2ltYWdlcy9zd3hh
LmdpZiI7DQogICAgd2luZG93LnNldFRpbWVvdXQoZG9uZSwgNDAwKTsNCn0NCmZ1bmN0aW9uIGRv
bmUoKSB7DQogICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChpbWcpOw0KfQ0KPC9zY3JpcHQ+
DQo8Ym9keSBvbmxvYWQ9InJ1bigpIj4NCjxpbnB1dCB0eXBlPWJ1dHRvbiB2YWx1ZT1QbGF5IG9u
Y2xpY2s9InJ1bigpIj4NCjxicj48YnI+DQo8L2JvZHk+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>109359</attachid>
            <date>2011-09-30 15:43:25 -0700</date>
            <delta_ts>2011-09-30 15:43:25 -0700</delta_ts>
            <desc>Real second testcase</desc>
            <filename>foo.html</filename>
            <type>text/html</type>
            <size>382</size>
            <attacher name="Peter Kasting">pkasting</attacher>
            
              <data encoding="base64">PHNjcmlwdD4NCnZhciBpbWcgPSBuZXcgSW1hZ2UoKTsNCmltZy5zcmMgPSAiaHR0cDovL3d3dy5n
b29nbGUuY29tL2ltYWdlcy9zd3hhLmdpZiI7DQpmdW5jdGlvbiBydW4oKSB7DQogIGRvY3VtZW50
LmJvZHkuYXBwZW5kQ2hpbGQoaW1nKTsNCiAgd2luZG93LnNldFRpbWVvdXQoZG9uZSwgNzUwKTsN
Cn0NCmZ1bmN0aW9uIGRvbmUoKSB7DQogIGRvY3VtZW50LmJvZHkucmVtb3ZlQ2hpbGQoaW1nKTsN
Cn0NCjwvc2NyaXB0Pg0KPGJvZHkgb25sb2FkPSJydW4oKSI+DQo8aW1nIHNyYz0iaHR0cDovL3d3
dy5nb29nbGUuY29tL2ltYWdlcy9zd3hhLmdpZiI+DQo8aW5wdXQgdHlwZT1idXR0b24gdmFsdWU9
UGxheSBvbmNsaWNrPSJydW4oKSI+DQo8YnI+PGJyPg0KPC9ib2R5Pg==
</data>

          </attachment>
      

    </bug>

</bugzilla>