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 215887e5eeffbbc952ce234576e62f4eddd24744..e0e1039a0786687e37218590d129bc51c1a4d91b 100644 |
| --- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp |
| +++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp |
| @@ -6,12 +6,15 @@ |
| #include "bindings/core/v8/Iterable.h" |
| #include "core/CSSPropertyNames.h" |
| +#include "core/css/CSSCustomIdentValue.h" |
| +#include "core/css/CSSCustomPropertyDeclaration.h" |
| #include "core/css/CSSPrimitiveValue.h" |
| #include "core/css/CSSPropertyMetadata.h" |
| #include "core/css/CSSValueList.h" |
| #include "core/css/StylePropertySet.h" |
| #include "core/css/cssom/CSSOMTypes.h" |
| #include "core/css/cssom/CSSSimpleLength.h" |
| +#include "core/css/cssom/CSSUnsupportedStyleValue.h" |
| #include "core/css/cssom/StyleValueFactory.h" |
| namespace blink { |
| @@ -148,13 +151,24 @@ HeapVector<StylePropertyMap::StylePropertyMapEntry> InlineStylePropertyMap::getI |
| for (unsigned i = 0; i < inlineStyleSet.propertyCount(); i++) { |
| StylePropertySet::PropertyReference propertyReference = inlineStyleSet.propertyAt(i); |
| CSSPropertyID propertyID = propertyReference.id(); |
| - CSSStyleValueVector styleValueVector = StyleValueFactory::cssValueToStyleValueVector(propertyID, *propertyReference.value()); |
| + String name; |
| CSSStyleValueOrCSSStyleValueSequence value; |
| - if (styleValueVector.size() == 1) |
| - value.setCSSStyleValue(styleValueVector[0]); |
| - else |
| - value.setCSSStyleValueSequence(styleValueVector); |
| - result.append(std::make_pair(getPropertyNameString(propertyID), value)); |
| + if (propertyID == CSSPropertyVariable) { |
| + const CSSCustomPropertyDeclaration* customDeclaration = toCSSCustomPropertyDeclaration(propertyReference.value()); |
| + name = customDeclaration->name(); |
| + value.setCSSStyleValue(CSSUnsupportedStyleValue::create(customDeclaration->customCSSText())); |
|
Timothy Loh
2016/07/01 00:57:11
I just checked the impl and it looks like it isn't
meade_UTC10
2016/07/05 00:45:29
Done.
|
| + } else if (propertyID == CSSPropertyApplyAtRule) { |
| + name = "@apply"; |
| + value.setCSSStyleValue(CSSUnsupportedStyleValue::create(toCSSCustomIdentValue(propertyReference.value())->value())); |
| + } else { |
| + name = getPropertyNameString(propertyID); |
| + CSSStyleValueVector styleValueVector = StyleValueFactory::cssValueToStyleValueVector(propertyID, *propertyReference.value()); |
| + if (styleValueVector.size() == 1) |
| + value.setCSSStyleValue(styleValueVector[0]); |
| + else |
| + value.setCSSStyleValueSequence(styleValueVector); |
| + } |
| + result.append(std::make_pair(name, value)); |
| } |
| return result; |
| } |