Source/WebCore/ChangeLog

 12011-07-27 Scott Graham <scottmg@google.com>
 2
 3 Different elapsed times used during update of animation
 4 https://bugs.webkit.org/show_bug.cgi?id=65274
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 When updating animations, save and use the elapsed time as
 9 m_elapsedForAnimationUpdate so that all animations are updated
 10 consistently rather than resampling the clock repeatedly.
 11
 12 No new tests, but existing svg animations should continue to work
 13 correctly, and elapsed() is stable when stepping in debugger.
 14
 15 * svg/animation/SMILTimeContainer.cpp:
 16 (WebCore::SMILTimeContainer::SMILTimeContainer):
 17 (WebCore::SMILTimeContainer::elapsed):
 18 (WebCore::SMILTimeContainer::updateAnimations):
 19 * svg/animation/SMILTimeContainer.h:
 20
1212011-07-25 Mihai Parparita <mihaip@chromium.org>
222
323 [Chromium] Add better WebKit API for chrome.tabs.insertCSS extension API

Source/WebCore/svg/animation/SMILTimeContainer.cpp

@@SMILTimeContainer::SMILTimeContainer(SVGSVGElement* owner)
4646 : m_beginTime(0)
4747 , m_pauseTime(0)
4848 , m_accumulatedPauseTime(0)
 49 , m_elapsedForAnimationUpdate(-1)
4950 , m_documentOrderIndexesDirty(false)
5051 , m_timer(this, &SMILTimeContainer::timerFired)
5152 , m_ownerSVGElement(owner)

@@SMILTime SMILTimeContainer::elapsed() const
8283{
8384 if (!m_beginTime)
8485 return 0;
 86
 87 if (m_elapsedForAnimationUpdate >= 0.0)
 88 return m_elapsedForAnimationUpdate;
 89
8590 return currentTime() - m_beginTime - m_accumulatedPauseTime;
8691}
8792

@@void SMILTimeContainer::updateAnimations(SMILTime elapsed, double nextManualSamp
244249 elapsed = SMILTime(nextManualSampleTime) + samplingDiff;
245250 }
246251
 252 m_elapsedForAnimationUpdate = elapsed.value();
 253
247254 // Sort according to priority. Elements with later begin time have higher priority.
248255 // In case of a tie, document order decides.
249256 // FIXME: This should also consider timing relationships between the elements. Dependents

@@void SMILTimeContainer::updateAnimations(SMILTime elapsed, double nextManualSamp
309316 startTimer(earliersFireTime, animationFrameDelay);
310317
311318 Document::updateStyleForAllDocuments();
 319
 320 m_elapsedForAnimationUpdate = -1;
312321}
313322
314323#endif

Source/WebCore/svg/animation/SMILTimeContainer.h

@@private:
8181 double m_beginTime;
8282 double m_pauseTime;
8383 double m_accumulatedPauseTime;
 84 double m_elapsedForAnimationUpdate;
8485
8586 bool m_documentOrderIndexesDirty;
8687