| Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| index 148d751dc42dd5cdc3b08435dd7d590110ebf414..e4402ca53b6f184c7597962f2942287aa310573e 100644
|
| --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| @@ -1826,24 +1826,43 @@ void ComputedStyle::setResolvedNonInheritedVariable(
|
| variables.setRegisteredVariable(name, parsedValue);
|
| }
|
|
|
| -void ComputedStyle::removeInheritedVariable(const AtomicString& name) {
|
| - mutableInheritedVariables().removeVariable(name);
|
| +void ComputedStyle::removeVariable(const AtomicString& name,
|
| + bool isInheritedProperty) {
|
| + if (isInheritedProperty) {
|
| + mutableInheritedVariables().removeVariable(name);
|
| + } else {
|
| + mutableNonInheritedVariables().removeVariable(name);
|
| + }
|
| }
|
|
|
| -void ComputedStyle::removeNonInheritedVariable(const AtomicString& name) {
|
| - mutableNonInheritedVariables().removeVariable(name);
|
| +CSSVariableData* ComputedStyle::getVariable(const AtomicString& name) const {
|
| + CSSVariableData* variable = getVariable(name, true);
|
| + if (variable) {
|
| + return variable;
|
| + }
|
| + return getVariable(name, false);
|
| }
|
|
|
| -CSSVariableData* ComputedStyle::getVariable(const AtomicString& name) const {
|
| - if (inheritedVariables()) {
|
| - if (CSSVariableData* variable = inheritedVariables()->getVariable(name))
|
| - return variable;
|
| +CSSVariableData* ComputedStyle::getVariable(const AtomicString& name,
|
| + bool isInheritedProperty) const {
|
| + if (isInheritedProperty) {
|
| + return inheritedVariables() ? inheritedVariables()->getVariable(name)
|
| + : nullptr;
|
| }
|
| - if (nonInheritedVariables()) {
|
| - if (CSSVariableData* variable = nonInheritedVariables()->getVariable(name))
|
| - return variable;
|
| + return nonInheritedVariables() ? nonInheritedVariables()->getVariable(name)
|
| + : nullptr;
|
| +}
|
| +
|
| +const CSSValue* ComputedStyle::getRegisteredVariable(
|
| + const AtomicString& name,
|
| + bool isInheritedProperty) const {
|
| + if (isInheritedProperty) {
|
| + return inheritedVariables() ? inheritedVariables()->registeredVariable(name)
|
| + : nullptr;
|
| }
|
| - return nullptr;
|
| + return nonInheritedVariables()
|
| + ? nonInheritedVariables()->registeredVariable(name)
|
| + : nullptr;
|
| }
|
|
|
| float ComputedStyle::wordSpacing() const {
|
|
|