void CompositorAnimations::cancelIncompatibleAnimationsOnCompositor(const Element& targetElement, const AnimationPlayer& playerToAdd, const AnimationEffect& effectToAdd)
{
    const bool affectsOpacity = effectToAdd.affects(CSSPropertyOpacity);
    const bool affectsTransform = effectToAdd.affects(CSSPropertyTransform);
    const bool affectsFilter = effectToAdd.affects(CSSPropertyWebkitFilter);

    if (!targetElement.hasAnimations())
        return;

    ElementAnimations* elementAnimations = targetElement.elementAnimations();
    ASSERT(elementAnimations);

    for (const auto& entry : elementAnimations->players()) {
        AnimationPlayer* attachedPlayer = entry.key;
        if (!considerPlayerAsIncompatible(*attachedPlayer, playerToAdd))
            continue;

        if ((affectsOpacity && attachedPlayer->affects(targetElement, CSSPropertyOpacity))
            || (affectsTransform && attachedPlayer->affects(targetElement, CSSPropertyTransform))
            || (affectsFilter && attachedPlayer->affects(targetElement, CSSPropertyWebkitFilter)))
            attachedPlayer->cancelAnimationOnCompositor();
    }
}