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

Unified Diff: third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h

Issue 2317903003: Add CSS property priority for CSS animation affecting properties (Closed)
Patch Set: Rebase onto latest optimisation Created 4 years, 1 month 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: third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h b/third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h
index ed6b7f46526b747ac5b5d26de22f3d2b2c009a42..fc511fdaa26ffa06eec7c51c16ed5226d2f1ab8b 100644
--- a/third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h
+++ b/third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h
@@ -16,6 +16,7 @@ namespace blink {
enum CSSPropertyPriority {
ResolveVariables = 0,
+ AnimationPropertyPriority,
HighPropertyPriority,
LowPropertyPriority,
PropertyPriorityCount,
@@ -47,8 +48,31 @@ inline CSSPropertyID CSSPropertyPriorityData<ResolveVariables>::last() {
}
template <>
+inline CSSPropertyID
+CSSPropertyPriorityData<AnimationPropertyPriority>::first() {
+ static_assert(CSSPropertyAnimationDelay == firstCSSProperty,
+ "CSSPropertyAnimationDelay should be the first animation "
+ "priority property");
+ return CSSPropertyAnimationDelay;
+}
+
+template <>
+inline CSSPropertyID
+CSSPropertyPriorityData<AnimationPropertyPriority>::last() {
+ static_assert(
+ CSSPropertyTransitionTimingFunction == CSSPropertyAnimationDelay + 11,
+ "CSSPropertyTransitionTimingFunction should be the end of the high "
+ "priority property range");
+ static_assert(
+ CSSPropertyColor == CSSPropertyTransitionTimingFunction + 1,
+ "CSSPropertyTransitionTimingFunction should be immediately before "
+ "CSSPropertyColor");
+ return CSSPropertyTransitionTimingFunction;
+}
+
+template <>
inline CSSPropertyID CSSPropertyPriorityData<HighPropertyPriority>::first() {
- static_assert(CSSPropertyColor == firstCSSProperty,
+ static_assert(CSSPropertyColor == CSSPropertyTransitionTimingFunction + 1,
"CSSPropertyColor should be the first high priority property");
return CSSPropertyColor;
}
@@ -86,6 +110,10 @@ inline CSSPropertyPriority priorityForProperty(CSSPropertyID property) {
property)) {
return HighPropertyPriority;
}
+ if (CSSPropertyPriorityData<AnimationPropertyPriority>::propertyHasPriority(
+ property)) {
+ return AnimationPropertyPriority;
+ }
DCHECK(
CSSPropertyPriorityData<ResolveVariables>::propertyHasPriority(property));
return ResolveVariables;
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.in ('k') | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698