Chromium Code Reviews| 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..274aaa902e86aa31c34a82347873b8bab5695aca 100644 |
| --- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp |
| +++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp |
| @@ -50,11 +50,25 @@ CSSStyleValueVector InlineStylePropertyMap::getAllInternal(AtomicString customPr |
| Vector<String> InlineStylePropertyMap::getProperties() |
| { |
| + DEFINE_STATIC_LOCAL(const String, kAtApply, "@apply"); |
| Vector<String> result; |
| + bool containsAtApply = false; |
| 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) { |
| + if (!containsAtApply) { |
| + result.append(kAtApply); |
|
esprehn
2016/08/10 04:01:06
Hmm, I also wonder if we're supposed to add the na
meade_UTC10
2016/08/10 04:22:32
The spec doesn't say anything at all about @apply
|
| + containsAtApply = true; |
| + } |
| + } else { |
| + DCHECK(propertyID >= firstCSSProperty && propertyID <= lastUnresolvedCSSProperty); |
|
esprehn
2016/08/10 04:01:06
getPropertyNameString actually contains this asser
meade_UTC10
2016/08/10 04:22:32
Removed.
|
| + result.append(getPropertyNameString(propertyID)); |
| + } |
| } |
| return result; |
| } |
| @@ -146,6 +160,7 @@ void InlineStylePropertyMap::remove(CSSPropertyID propertyID, ExceptionState& ex |
| HeapVector<StylePropertyMap::StylePropertyMapEntry> InlineStylePropertyMap::getIterationEntries() |
| { |
| + DEFINE_STATIC_LOCAL(const String, kAtApply, "@apply"); |
| HeapVector<StylePropertyMap::StylePropertyMapEntry> result; |
| StylePropertySet& inlineStyleSet = m_ownerElement->ensureMutableInlineStyle(); |
| for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) { |
| @@ -159,7 +174,7 @@ HeapVector<StylePropertyMap::StylePropertyMapEntry> InlineStylePropertyMap::getI |
| // TODO(meade): Eventually custom properties will support other types, so actually return them instead of always returning a CSSUnsupportedStyleValue. |
| value.setCSSStyleValue(CSSUnsupportedStyleValue::create(customDeclaration.customCSSText())); |
| } else if (propertyID == CSSPropertyApplyAtRule) { |
| - name = "@apply"; |
| + name = kAtApply; |
| value.setCSSStyleValue(CSSUnsupportedStyleValue::create(toCSSCustomIdentValue(propertyReference.value()).value())); |
| } else { |
| name = getPropertyNameString(propertyID); |