Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 814083003: Update animation when changes in animation keyframes are detected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Detect when style changes to a different object Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 074eeb7c96183fe2185425ff32ef00c2ba0f2bda..ab8857a1731f5ddc53408b52c6211296673756f8 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -1038,7 +1038,7 @@ void StyleResolver::resolveScopedStyles(const Element* element, WillBeHeapVector
resolvers.append(scopedResolver);
}
-const StyleRuleKeyframes* StyleResolver::findKeyframesRule(const Element* element, const AtomicString& animationName)
+const StyleRuleKeyframes* StyleResolver::findKeyframesRule(const Element* element, const AtomicString& animationName) const
{
WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8> resolvers;
collectScopedResolversForHostedShadowTrees(element, resolvers);
@@ -1046,7 +1046,21 @@ const StyleRuleKeyframes* StyleResolver::findKeyframesRule(const Element* elemen
resolvers.append(scopedResolver);
for (size_t i = 0; i < resolvers.size(); ++i) {
- if (const StyleRuleKeyframes* keyframesRule = resolvers[i]->keyframeStylesForAnimation(animationName.impl()))
+ if (const StyleRuleKeyframes* keyframesRule = resolvers[i]->keyframeStylesForAnimation(animationName.impl()).get())
+ return keyframesRule;
+ }
+ return nullptr;
+}
+
+PassRefPtrWillBeRawPtr<StyleRuleKeyframes> StyleResolver::findKeyframesRule(const Element* element, const AtomicString& animationName)
+{
+ WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8> resolvers;
+ collectScopedResolversForHostedShadowTrees(element, resolvers);
+ if (ScopedStyleResolver* scopedResolver = element->treeScope().scopedStyleResolver())
+ resolvers.append(scopedResolver);
+
+ for (size_t i = 0; i < resolvers.size(); ++i) {
+ if (RefPtrWillBeRawPtr<StyleRuleKeyframes> keyframesRule = resolvers[i]->keyframeStylesForAnimation(animationName.impl()))
return keyframesRule;
}
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698