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

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

Issue 1645433002: Basic implementation of @apply (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix expted.txt for failing test Created 4 years, 10 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 82dda72e3686a62958a196917ddb15b19d43076c..7596bafd44fb3068bf13a3f0808e0f9b787b872d 100644
--- a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
+++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
@@ -192,6 +192,17 @@ String StylePropertySerializer::getCustomPropertyText(const PropertyValueForSeri
return result.toString();
}
+static String getApplyAtRuleText(const CSSValue* value, bool isNotFirstDecl)
+{
+ StringBuilder result;
+ if (isNotFirstDecl)
+ result.append(' ');
+ result.appendLiteral("@apply ");
+ result.append(toCSSCustomIdentValue(value)->value());
+ result.append(';');
+ return result.toString();
+}
+
String StylePropertySerializer::getPropertyText(CSSPropertyID propertyID, const String& value, bool isImportant, bool isNotFirstDecl) const
{
StringBuilder result;
@@ -367,6 +378,9 @@ String StylePropertySerializer::asText() const
case CSSPropertyAll:
result.append(getPropertyText(propertyID, property.value()->cssText(), property.isImportant(), numDecls++));
continue;
+ case CSSPropertyApplyAtRule:
+ result.append(getApplyAtRuleText(property.value(), numDecls++));
+ continue;
default:
break;
}

Powered by Google App Engine
This is Rietveld 408576698