Chromium Code Reviews| 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 7fbcc82f295c4fe5a9262d0c67c628545fcaa9f0..08db13def869a7d84a2ab03df1efeb663de58b75 100644 |
| --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp |
| +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp |
| @@ -1018,18 +1018,11 @@ bool ComputedStyle::diffNeedsPaintInvalidationObjectForPaintImage( |
| return true; |
| } |
| - if (inheritedVariables() || other.inheritedVariables()) { |
| + if (inheritedVariables() || nonInheritedVariables() || |
| + other.inheritedVariables() || other.nonInheritedVariables()) { |
|
meade_UTC10
2016/10/19 07:41:14
There are variables that aren't inherited or non-i
Timothy Loh
2016/10/20 06:05:17
There's just no function right now that checks whe
|
| for (const AtomicString& property : |
| *value->customInvalidationProperties()) { |
| - CSSVariableData* thisVar = |
| - inheritedVariables() ? inheritedVariables()->getVariable(property) |
| - : nullptr; |
| - CSSVariableData* otherVar = |
| - other.inheritedVariables() |
| - ? other.inheritedVariables()->getVariable(property) |
| - : nullptr; |
| - |
| - if (!dataEquivalent(thisVar, otherVar)) |
| + if (!dataEquivalent(getVariable(property), other.getVariable(property))) |
| return true; |
| } |
| } |
| @@ -1780,6 +1773,18 @@ void ComputedStyle::removeNonInheritedVariable(const AtomicString& name) { |
| mutableNonInheritedVariables().removeVariable(name); |
| } |
| +CSSVariableData* ComputedStyle::getVariable(const AtomicString& name) const { |
| + if (inheritedVariables()) { |
| + if (CSSVariableData* variable = inheritedVariables()->getVariable(name)) |
| + return variable; |
| + } |
| + if (nonInheritedVariables()) { |
| + if (CSSVariableData* variable = nonInheritedVariables()->getVariable(name)) |
| + return variable; |
| + } |
| + return nullptr; |
| +} |
| + |
| float ComputedStyle::wordSpacing() const { |
| return getFontDescription().wordSpacing(); |
| } |