-bool MutableStylePropertySet::setVariableValue(const AtomicString& name, const String& value, bool important)
-{
- ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
- if (value.isEmpty())
- return removeVariable(name);
-
- size_t index = findVariableIndex(name);
- if (index != kNotFound) {
- const CSSValue* cssValue = m_propertyVector.at(index).value();
- if (toCSSVariableValue(cssValue)->value() == value)
- return false;
- }
-
- CSSProperty property(CSSPropertyVariable, CSSVariableValue::create(name, value), important);
- if (index == kNotFound) {
- m_propertyVector.append(property);
- return true;
- }
- m_propertyVector.at(index) = property;
- return false;
-}
-