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

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

Issue 2255273002: implicit WIP Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/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()) {
« 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