Bug 1415780 - Make AnimationEventDispatcher::SortEvents() private. r=birtles

Now we sort pending events only when dispatching the events, i.e.
only inside DispatchEvent().

MozReview-Commit-ID: IRqH56BEnKb

--HG--
extra : rebase_source : dd2b8528fdc36d1371815feaf07ead0b258fe453
This commit is contained in:
Hiroyuki Ikezoe 2018-01-27 16:55:45 +09:00
Родитель 99f98b1bd6
Коммит 9e4cc95a63
1 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -116,22 +116,6 @@ public:
mIsSorted = false;
}
// Sort all pending CSS animation/transition events by scheduled event time
// and composite order.
// https://drafts.csswg.org/web-animations/#update-animations-and-send-events
void SortEvents()
{
if (mIsSorted) {
return;
}
// FIXME: Replace with mPendingEvents.StableSort when bug 1147091 is
// fixed.
std::stable_sort(mPendingEvents.begin(), mPendingEvents.end(),
AnimationEventInfoLessThan());
mIsSorted = true;
}
// This will call SortEvents automatically if it has not already been
// called.
void DispatchEvents()
@ -191,6 +175,22 @@ private:
}
};
// Sort all pending CSS animation/transition events by scheduled event time
// and composite order.
// https://drafts.csswg.org/web-animations/#update-animations-and-send-events
void SortEvents()
{
if (mIsSorted) {
return;
}
// FIXME: Replace with mPendingEvents.StableSort when bug 1147091 is
// fixed.
std::stable_sort(mPendingEvents.begin(), mPendingEvents.end(),
AnimationEventInfoLessThan());
mIsSorted = true;
}
nsPresContext* mPresContext;
typedef nsTArray<AnimationEventInfo> EventArray;
EventArray mPendingEvents;