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

Unified Diff: Source/core/css/StylePropertyShorthandCustom.cpp

Issue 298043007: Support unknown property strings in transition-property (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
Index: Source/core/css/StylePropertyShorthandCustom.cpp
diff --git a/Source/core/css/StylePropertyShorthandCustom.cpp b/Source/core/css/StylePropertyShorthandCustom.cpp
index b157746c8b99736ec302206f380d2deb93dc3e79..b3351186067c0c17c1eb09c291869556a9f3d3fc 100644
--- a/Source/core/css/StylePropertyShorthandCustom.cpp
+++ b/Source/core/css/StylePropertyShorthandCustom.cpp
@@ -86,6 +86,31 @@ const StylePropertyShorthand& webkitAnimationShorthandForParsing()
return webkitAnimationLonghandsForParsing;
}
+// Similar to animations, we have property after timing-function and delay after duration
+const StylePropertyShorthand& transitionShorthandForParsing()
+{
+ static const CSSPropertyID transitionProperties[] = {
+ CSSPropertyTransitionDuration,
+ CSSPropertyTransitionTimingFunction,
+ CSSPropertyTransitionDelay,
+ CSSPropertyTransitionProperty
+ };
+ DEFINE_STATIC_LOCAL(StylePropertyShorthand, transitionLonghands, (CSSPropertyTransition, transitionProperties, WTF_ARRAY_LENGTH(transitionProperties)));
+ return transitionLonghands;
+}
+
+const StylePropertyShorthand& webkitTransitionShorthandForParsing()
+{
+ static const CSSPropertyID webkitTransitionProperties[] = {
+ CSSPropertyWebkitTransitionDuration,
+ CSSPropertyWebkitTransitionTimingFunction,
+ CSSPropertyWebkitTransitionDelay,
+ CSSPropertyWebkitTransitionProperty
+ };
+ DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitTransitionLonghands, (CSSPropertyWebkitTransition, webkitTransitionProperties, WTF_ARRAY_LENGTH(webkitTransitionProperties)));
+ return webkitTransitionLonghands;
+}
+
// Returns an empty list if the property is not a shorthand, otherwise the list of longhands for parsing.
const StylePropertyShorthand& parsingShorthandForProperty(CSSPropertyID propertyID)
{
@@ -96,6 +121,10 @@ const StylePropertyShorthand& parsingShorthandForProperty(CSSPropertyID property
return borderShorthandForParsing();
case CSSPropertyWebkitAnimation:
return webkitAnimationShorthandForParsing();
+ case CSSPropertyTransition:
+ return transitionShorthandForParsing();
+ case CSSPropertyWebkitTransition:
+ return webkitTransitionShorthandForParsing();
default:
return shorthandForProperty(propertyID);
}

Powered by Google App Engine
This is Rietveld 408576698