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

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: Fix serialization and temporary property value caching. Add some additional tests. 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 ae217b6d488130767845519d84ab027f648ea01a..af763259c67fad6441fee8aaa0e6ae5dc63f0917 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();
}
@@ -675,6 +680,7 @@ String StylePropertySerializer::getLayeredShorthandValue(const StylePropertyShor
for (size_t i = 0; i < size; i++) {
values[i] = m_propertySet.getPropertyCSSValue(shorthand.properties()[i]);
+
Timothy Loh 2016/06/27 04:19:09 blank line not related :)
Andy Mutton 2016/06/28 03:18:51 Done.
if (values[i]->isBaseValueList()) {
const CSSValueList* valueList = toCSSValueList(values[i]);
numLayers = std::max(numLayers, valueList->length());

Powered by Google App Engine
This is Rietveld 408576698