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

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

Issue 2089593002: Add expansion of shorthands with custom properties to longhands using a pending substition value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renames, signature update and master merge Created 4 years, 6 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: 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 9f8264f52773f604f8d37cd5a99c2d9ebb68be27..02a5a13a4155c09d25b6ef8edcae1c3bb2c15749 100644
--- a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
+++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
@@ -25,6 +25,7 @@
#include "core/CSSValueKeywords.h"
#include "core/StylePropertyShorthand.h"
#include "core/css/CSSCustomPropertyDeclaration.h"
+#include "core/css/CSSPendingSubstitutionValue.h"
#include "core/css/CSSPropertyMetadata.h"
#include "core/css/CSSValuePool.h"
#include "wtf/StdLibExtras.h"
@@ -372,7 +373,8 @@ String StylePropertySerializer::commonShorthandChecks(const StylePropertyShortha
return emptyString();
// TODO(timloh): This should be isCSSWideKeyword()
- if (longhands[0]->isInitialValue() || longhands[0]->isInheritedValue()) {
+ if (longhands[0]->isInitialValue() || longhands[0]->isInheritedValue()
+ || longhands[0]->isPendingSubstitutionValue()) {
bool success = true;
for (int i = 1; i < longhandCount; i++) {
if (!longhands[i]->equals(*longhands[0])) {
@@ -382,8 +384,11 @@ String StylePropertySerializer::commonShorthandChecks(const StylePropertyShortha
break;
}
}
- if (success)
+ if (success) {
+ if (longhands[0]->isPendingSubstitutionValue())
+ return toCSSPendingSubstitutionValue(longhands[0])->shorthandValue()->cssText();
return longhands[0]->cssText();
+ }
}
bool allowInitial = allowInitialInShorthand(shorthand.id());
@@ -398,7 +403,7 @@ String StylePropertySerializer::commonShorthandChecks(const StylePropertyShortha
if (!allowInitial && value.isInitialValue())
return emptyString();
// TODO(timloh): This should also check unset
- if (value.isInheritedValue())
+ if (value.isInheritedValue() || value.isPendingSubstitutionValue())
return emptyString();
if (value.isVariableReferenceValue())
return emptyString();
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValue.cpp ('k') | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698