| Index: Source/core/css/CSSComputedStyleDeclaration.cpp
|
| diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
|
| index f0f308782671a9e52ec4b5d5cdc7ed8f2d1eacba..9f9bd4960164b8df95bbc7ba69329b3d78d0ad24 100644
|
| --- a/Source/core/css/CSSComputedStyleDeclaration.cpp
|
| +++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
|
| @@ -26,6 +26,7 @@
|
|
|
| #include "CSSPropertyNames.h"
|
| #include "FontFamilyNames.h"
|
| +#include "RuntimeEnabledFeatures.h"
|
| #include "core/css/BasicShapeFunctions.h"
|
| #include "core/css/CSSArrayFunctionValue.h"
|
| #include "core/css/CSSAspectRatioValue.h"
|
| @@ -3007,6 +3008,57 @@ void CSSComputedStyleDeclaration::setPropertyInternal(CSSPropertyID, const Strin
|
| ec = NO_MODIFICATION_ALLOWED_ERR;
|
| }
|
|
|
| +const HashMap<AtomicString, String>* CSSComputedStyleDeclaration::variableMap() const
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + Node* styledNode = this->styledNode();
|
| + if (!styledNode)
|
| + return 0;
|
| + RefPtr<RenderStyle> style = styledNode->computedStyle(styledNode->isPseudoElement() ? NOPSEUDO : m_pseudoElementSpecifier);
|
| + if (!style)
|
| + return 0;
|
| + return style->variables();
|
| +}
|
| +
|
| +unsigned CSSComputedStyleDeclaration::variableCount() const
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + const HashMap<AtomicString, String>* variables = variableMap();
|
| + if (!variables)
|
| + return 0;
|
| + return variables->size();
|
| +}
|
| +
|
| +String CSSComputedStyleDeclaration::variableValue(const AtomicString& name) const
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + const HashMap<AtomicString, String>* variables = variableMap();
|
| + if (!variables)
|
| + return emptyString();
|
| + HashMap<AtomicString, String>::const_iterator it = variables->find(name);
|
| + if (it == variables->end())
|
| + return emptyString();
|
| + return it->value;
|
| +}
|
| +
|
| +void CSSComputedStyleDeclaration::setVariableValue(const AtomicString&, const String&, ExceptionCode& ec)
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + ec = NO_MODIFICATION_ALLOWED_ERR;
|
| +}
|
| +
|
| +bool CSSComputedStyleDeclaration::removeVariable(const AtomicString&)
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + return false;
|
| +}
|
| +
|
| +void CSSComputedStyleDeclaration::clearVariables(ExceptionCode& ec)
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + ec = NO_MODIFICATION_ALLOWED_ERR;
|
| +}
|
| +
|
| PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::getBackgroundShorthandValue() const
|
| {
|
| static const CSSPropertyID propertiesBeforeSlashSeperator[5] = { CSSPropertyBackgroundColor, CSSPropertyBackgroundImage,
|
|
|