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

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

Issue 617493002: Only default to transition shorthand if all 4 values are set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Also add check for animation Created 6 years, 3 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 | « Source/core/css/StylePropertySerializer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StylePropertySerializer.cpp
diff --git a/Source/core/css/StylePropertySerializer.cpp b/Source/core/css/StylePropertySerializer.cpp
index eb4f6823a2ef16c9857c06dd90a57d723fb795a0..1915957ccd92f946b73c4afb53ad6e3064f545ed 100644
--- a/Source/core/css/StylePropertySerializer.cpp
+++ b/Source/core/css/StylePropertySerializer.cpp
@@ -253,7 +253,7 @@ String StylePropertySerializer::getPropertyValue(CSSPropertyID propertyID) const
// Shorthand and 4-values properties
switch (propertyID) {
case CSSPropertyAnimation:
- return getLayeredShorthandValue(animationShorthand());
+ return getLayeredShorthandValue(animationShorthand(), true);
case CSSPropertyBorderSpacing:
return borderSpacingValue(borderSpacingShorthand());
case CSSPropertyBackgroundPosition:
@@ -305,7 +305,7 @@ String StylePropertySerializer::getPropertyValue(CSSPropertyID propertyID) const
case CSSPropertyPadding:
return get4Values(paddingShorthand());
case CSSPropertyTransition:
- return getLayeredShorthandValue(transitionShorthand());
+ return getLayeredShorthandValue(transitionShorthand(), true);
case CSSPropertyListStyle:
return getShorthandValue(listStyleShorthand());
case CSSPropertyWebkitMaskPosition:
@@ -322,9 +322,9 @@ String StylePropertySerializer::getPropertyValue(CSSPropertyID propertyID) const
case CSSPropertyWebkitTransformOrigin:
return getShorthandValue(webkitTransformOriginShorthand());
case CSSPropertyWebkitTransition:
- return getLayeredShorthandValue(webkitTransitionShorthand());
+ return getLayeredShorthandValue(webkitTransitionShorthand(), true);
case CSSPropertyWebkitAnimation:
- return getLayeredShorthandValue(webkitAnimationShorthand());
+ return getLayeredShorthandValue(webkitAnimationShorthand(), true);
case CSSPropertyMarker: {
RefPtrWillBeRawPtr<CSSValue> value = m_propertySet.getPropertyCSSValue(CSSPropertyMarkerStart);
if (value)
@@ -476,7 +476,7 @@ String StylePropertySerializer::get4Values(const StylePropertyShorthand& shortha
return result.toString();
}
-String StylePropertySerializer::getLayeredShorthandValue(const StylePropertyShorthand& shorthand) const
+String StylePropertySerializer::getLayeredShorthandValue(const StylePropertyShorthand& shorthand, bool checkShorthandAvailable) const
{
StringBuilder result;
@@ -494,9 +494,12 @@ String StylePropertySerializer::getLayeredShorthandValue(const StylePropertyShor
} else {
numLayers = std::max<size_t>(1U, numLayers);
}
+ } else if (checkShorthandAvailable) {
+ return String();
}
}
+
String commonValue;
bool commonValueInitialized = false;
« no previous file with comments | « Source/core/css/StylePropertySerializer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698