Commit 48abeaf3 authored by loyso's avatar loyso Committed by Commit bot

Blink CompositorAnimations: Do not crash if no compositor animation player.

blink::Animation can loose compositorPlayer if Animation::m_content detached via
Animation::setEffect(nullptr)

If KeyframeEffect::cancelAnimationOnCompositor wants to clear m_compositorAnimationIds
then it shouldn't crash.

Also, note the existing comment in CompositorAnimations::cancelAnimationOnCompositor (above changed lines)

BUG=571504
R=dstockwell@chromium.org

Review URL: https://codereview.chromium.org/1543143002

Cr-Commit-Position: refs/heads/master@{#367055}
parent 3ab540e9
...@@ -383,8 +383,8 @@ void CompositorAnimations::cancelAnimationOnCompositor(const Element& element, c ...@@ -383,8 +383,8 @@ void CompositorAnimations::cancelAnimationOnCompositor(const Element& element, c
} }
if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) {
WebCompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer(); WebCompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer();
ASSERT(compositorPlayer); if (compositorPlayer)
compositorPlayer->removeAnimation(id); compositorPlayer->removeAnimation(id);
} else { } else {
toLayoutBoxModelObject(element.layoutObject())->layer()->compositedLayerMapping()->mainGraphicsLayer()->removeAnimation(id); toLayoutBoxModelObject(element.layoutObject())->layer()->compositedLayerMapping()->mainGraphicsLayer()->removeAnimation(id);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment