+#if wxUSE_GIF && wxUSE_TIMER
+void wxHtmlImageCell::AdvanceAnimation(wxTimer *timer)
+{
+ wxImage img;
+
+ m_gifDecoder->GoNextFrame(TRUE);
+
+ if ( m_physX == -1 )
+ {
+ m_physX = m_physY = 0;
+ for (wxHtmlCell *cell = this; cell; cell = cell->GetParent())
+ {
+ m_physX += cell->GetPosX();
+ m_physY += cell->GetPosY();
+ }
+ }
+
+ int x, y;
+ m_window->CalcScrolledPosition(m_physX, m_physY, &x, &y);
+ wxRect rect(x, y, m_Width, m_Height);
+
+ if ( m_window->GetClientRect().Intersects(rect) &&
+ m_gifDecoder->ConvertToImage(&img) )
+ {
+ SetImage(img);
+ m_window->Refresh(img.HasMask(), &rect);
+ }
+
+ timer->Start(m_gifDecoder->GetDelay(), TRUE);
+}
+
+void wxHtmlImageCell::Layout(int w)
+{
+ wxHtmlCell::Layout(w);
+ m_physX = m_physY = -1;
+}
+
+#endif
+
+wxHtmlImageCell::~wxHtmlImageCell()
+{
+ delete m_bitmap;
+#if wxUSE_GIF && wxUSE_TIMER
+ delete m_gifTimer;
+ delete m_gifDecoder;
+#endif
+}