void
CommonAnimationManager::AddStyleUpdatesTo(RestyleTracker& aTracker)
{
    TimeStamp now = mPresContext->RefreshDriver()->MostRecentRefresh();

    PRCList* next = PR_LIST_HEAD(&mElementCollections);
    while (next != &mElementCollections) {
        AnimationPlayerCollection* collection =
            static_cast<AnimationPlayerCollection*>(next);
        next = PR_NEXT_LINK(next);

        if (!collection->mNeedsRefreshes) {
            continue;
        }

        collection->EnsureStyleRuleFor(now, EnsureStyleRule_IsNotThrottled);

        dom::Element* elementToRestyle = collection->GetElementToRestyle();
        if (elementToRestyle) {
            nsRestyleHint rshint = collection->IsForTransitions()
                                   ? eRestyle_CSSTransitions : eRestyle_CSSAnimations;
            aTracker.AddPendingRestyle(elementToRestyle, rshint, nsChangeHint(0));
        }
    }
}