| Index: Source/core/css/PropertySetCSSStyleDeclaration.cpp
|
| diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
|
| index e941ceca7bab3a29e94268c9ebb221ec82ccfac2..c9ba5fd0e685b4b86933a5aff610406616e89a81 100644
|
| --- a/Source/core/css/PropertySetCSSStyleDeclaration.cpp
|
| +++ b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
|
| @@ -23,6 +23,7 @@
|
| #include "core/css/PropertySetCSSStyleDeclaration.h"
|
|
|
| #include "HTMLNames.h"
|
| +#include "RuntimeEnabledFeatures.h"
|
| #include "core/css/CSSParser.h"
|
| #include "core/css/CSSStyleSheet.h"
|
| #include "core/css/StylePropertySet.h"
|
| @@ -280,6 +281,52 @@ void PropertySetCSSStyleDeclaration::setPropertyInternal(CSSPropertyID propertyI
|
| mutationScope.enqueueMutationRecord();
|
| }
|
|
|
| +unsigned PropertySetCSSStyleDeclaration::variableCount() const
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + return m_propertySet->variableCount();
|
| +}
|
| +
|
| +String PropertySetCSSStyleDeclaration::variableValue(const AtomicString& name) const
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + return m_propertySet->variableValue(name);
|
| +}
|
| +
|
| +void PropertySetCSSStyleDeclaration::setVariableValue(const AtomicString& name, const String& value, ExceptionCode& ec)
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + StyleAttributeMutationScope mutationScope(this);
|
| + willMutate();
|
| + bool changed = m_propertySet->setVariableValue(name, value, ec);
|
| + didMutate(changed ? PropertyChanged : NoChanges);
|
| + if (changed)
|
| + mutationScope.enqueueMutationRecord();
|
| +}
|
| +
|
| +bool PropertySetCSSStyleDeclaration::removeVariable(const AtomicString& name)
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + StyleAttributeMutationScope mutationScope(this);
|
| + willMutate();
|
| + bool changed = m_propertySet->removeVariable(name);
|
| + didMutate(changed ? PropertyChanged : NoChanges);
|
| + if (changed)
|
| + mutationScope.enqueueMutationRecord();
|
| + return changed;
|
| +}
|
| +
|
| +void PropertySetCSSStyleDeclaration::clearVariables(ExceptionCode&)
|
| +{
|
| + ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
|
| + StyleAttributeMutationScope mutationScope(this);
|
| + willMutate();
|
| + bool changed = m_propertySet->clearVariables();
|
| + didMutate(changed ? PropertyChanged : NoChanges);
|
| + if (changed)
|
| + mutationScope.enqueueMutationRecord();
|
| +}
|
| +
|
| CSSValue* PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM(CSSValue* internalValue)
|
| {
|
| if (!internalValue)
|
|
|