Bug 709256 part 5. Fast-path nsAnimationManager::DispatchEvents when there are no events. r=dbaron

This commit is contained in:
Boris Zbarsky 2011-12-14 23:42:15 -05:00
parent 06d90319eb
commit aec38ceac3
2 changed files with 10 additions and 2 deletions

View File

@ -904,7 +904,7 @@ nsAnimationManager::WillRefresh(mozilla::TimeStamp aTime)
}
void
nsAnimationManager::DispatchEvents()
nsAnimationManager::DoDispatchEvents()
{
EventArray events;
mPendingEvents.SwapElements(events);

View File

@ -131,7 +131,12 @@ public:
* accumulate animationstart events at other points when style
* contexts are created.
*/
void DispatchEvents();
void DispatchEvents() {
// Fast-path the common case: no events
if (!mPendingEvents.IsEmpty()) {
DoDispatchEvents();
}
}
private:
ElementAnimations* GetElementAnimations(mozilla::dom::Element *aElement,
@ -149,6 +154,9 @@ private:
nsCSSKeyframesRule* KeyframesRuleFor(const nsSubstring& aName);
// The guts of DispatchEvents
void DoDispatchEvents();
bool mKeyframesListIsDirty;
nsDataHashtable<nsStringHashKey, nsCSSKeyframesRule*> mKeyframesRules;