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

Unified Diff: third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp

Issue 2227503002: Allow use of @apply and custom properties in InlineStylePropertyMap::getProperties() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra if statement 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 | « third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getProperties.html ('k') | 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/cssom/InlineStylePropertyMap.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
index 43299903125d63987626dbe3b4c2c8309ca39f4f..c582d451b6aa6b9a88f0f98ff68e69ac7120c2f2 100644
--- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
@@ -54,7 +54,15 @@ Vector<String> InlineStylePropertyMap::getProperties()
StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle();
for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) {
CSSPropertyID propertyID = inlineStyleSet.propertyAt(i).id();
- result.append(getPropertyNameString(propertyID));
+ if (propertyID == CSSPropertyVariable) {
+ StylePropertySet::PropertyReference propertyReference = inlineStyleSet.propertyAt(i);
+ const CSSCustomPropertyDeclaration& customDeclaration = toCSSCustomPropertyDeclaration(propertyReference.value());
+ result.append(customDeclaration.name());
+ } else if (propertyID == CSSPropertyApplyAtRule) {
+ result.append("@apply");
esprehn 2016/08/10 00:39:43 This is mallocing a string for every @apply rule,
meade_UTC10 2016/08/10 01:59:35 Done.
+ } else {
+ result.append(getPropertyNameString(propertyID));
sashab 2016/08/09 01:14:36 Maybe add the if-statement back as a DCHECK? :)
meade_UTC10 2016/08/10 01:59:35 Done.
+ }
}
return result;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getProperties.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698