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; |