Index: third_party/WebKit/Source/core/css/StylePropertySerializer.cpp |
diff --git a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp |
index 72ace2c4594534ac0464970a4c34c23a34c52b59..bc3832d72f7e142da1ad8f92777caef5498168ac 100644 |
--- a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp |
+++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp |
@@ -287,50 +287,6 @@ String StylePropertySerializer::asText() const |
return result.toString(); |
} |
-// As per css-cascade, shorthands do not expand longhands to the value |
-// "initial", except when the shorthand is set to "initial", instead |
-// setting "missing" sub-properties to their initial values. This means |
-// that a shorthand can never represent a list of subproperties where |
-// some are "initial" and some are not, and so serialization should |
-// always fail in these cases (as per cssom). However we currently use |
-// "initial" instead of the initial values for certain shorthands, so |
-// these are special-cased here. |
-// TODO(timloh): Don't use "initial" in shorthands and remove this |
-// special-casing |
-static bool allowInitialInShorthand(CSSPropertyID propertyID) |
-{ |
- switch (propertyID) { |
- case CSSPropertyBorder: |
- case CSSPropertyBorderTop: |
- case CSSPropertyBorderRight: |
- case CSSPropertyBorderBottom: |
- case CSSPropertyBorderLeft: |
- case CSSPropertyOutline: |
- case CSSPropertyColumnRule: |
- case CSSPropertyColumns: |
- case CSSPropertyFlex: |
- case CSSPropertyFlexFlow: |
- case CSSPropertyGridColumn: |
- case CSSPropertyGridRow: |
- case CSSPropertyGridArea: |
- case CSSPropertyGridGap: |
- case CSSPropertyMotion: |
- case CSSPropertyWebkitMarginCollapse: |
- case CSSPropertyListStyle: |
- case CSSPropertyWebkitTextEmphasis: |
- case CSSPropertyWebkitTextStroke: |
- return true; |
- default: |
- return false; |
- } |
-} |
- |
-// TODO(timloh): This should go away eventually, see crbug.com/471917 |
-static bool allowImplicitInitialInShorthand(CSSPropertyID propertyID) |
-{ |
- return propertyID == CSSPropertyBackground || propertyID == CSSPropertyWebkitMask; |
-} |
- |
String StylePropertySerializer::commonShorthandChecks(const StylePropertyShorthand& shorthand) const |
{ |
int longhandCount = shorthand.length(); |
@@ -373,8 +329,8 @@ String StylePropertySerializer::commonShorthandChecks(const StylePropertyShortha |
} |
} |
- bool allowInitial = allowInitialInShorthand(shorthand.id()); |
- bool allowImplicitInitial = allowInitial || allowImplicitInitialInShorthand(shorthand.id()); |
+ bool allowInitial = false; |
+ bool allowImplicitInitial = true; |
for (int i = 0; i < longhandCount; i++) { |
const CSSValue& value = *longhands[i]; |
if (value.isImplicitInitialValue()) { |