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

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

Issue 2895913002: blink/css: Read animation keyframe rules in UA sheets for shadow DOM. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
index 2f576663e6ef833eda4cea6fa42d4172fb10743f..31527ca5f11e3f8d594ceabc2ba93eab29f13976 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -1214,6 +1214,20 @@ StyleRuleKeyframes* StyleResolver::FindKeyframesRule(
return keyframes_rule;
}
+ // This is a workaround for crbug.com/724975. Since the keyframe rules from
+ // UA style sheets are not available in the resolvers, read those rules
+ // directly here.
+ if (element->IsInShadowTree() &&
+ ToShadowRoot(element->GetTreeScope().RootNode()).GetType() ==
+ ShadowRootType::kUserAgent) {
+ const auto& keyframe_rules =
+ CSSDefaultStyleSheets::Instance().DefaultStyle()->KeyframesRules();
+ for (const auto& rule : keyframe_rules) {
+ if (rule->GetName() == animation_name)
+ return rule;
+ }
+ }
+
for (auto& resolver : resolvers)
resolver->SetHasUnresolvedKeyframesRule();
return nullptr;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698