Index: third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp |
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp |
index 9de013e0504219538784dd11a15444359931adb5..5eff4e8c0a6e852dced2c52ebf1a5f8a4fe11d43 100644 |
--- a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp |
+++ b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp |
@@ -306,10 +306,8 @@ void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate& update, const E |
timing.timingFunction = Timing::defaults().timingFunction; |
StyleRuleKeyframes* keyframesRule = resolver->findKeyframesRule(elementForScoping, name); |
- if (!keyframesRule) { |
- element.document().styleEngine().setHasUnresolvedKeyframesRule(); |
+ if (!keyframesRule) |
continue; // Cancel the animation if there's no style rule for it. |
- } |
const RunningAnimation* existingAnimation = nullptr; |
size_t existingAnimationIndex = 0; |
@@ -896,6 +894,19 @@ bool CSSAnimations::isAnimatableProperty(CSSPropertyID property) |
} |
} |
+bool CSSAnimations::isAffectedByKeyframesFromScope(const Element& element, const TreeScope& treeScope) |
+{ |
+ // Animated elements are affected by @keyframes rules from the same scope |
+ // and from their shadow sub-trees if they are shadow hosts. |
+ if (element.treeScope() == treeScope) |
+ return true; |
+ if (!isShadowHost(element)) |
+ return false; |
+ if (treeScope.rootNode() == treeScope.document()) |
+ return false; |
+ return toShadowRoot(treeScope.rootNode()).host() == element; |
+} |
+ |
DEFINE_TRACE(CSSAnimations) |
{ |
visitor->trace(m_transitions); |