| 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 8fc3dab289d1b4d853272aba7112c80f3d00a38b..1fcf1d3bd95be2b0dd94c44703468ad6c44cd534 100644
|
| --- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| +++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
|
| @@ -212,9 +212,14 @@ StyleRecalcChange ComputedStyle::stylePropagationDiff(
|
|
|
| bool independentEqual = oldStyle->independentInheritedEqual(*newStyle);
|
| bool nonIndependentEqual = oldStyle->nonIndependentInheritedEqual(*newStyle);
|
| - if (!independentEqual || !nonIndependentEqual) {
|
| + bool variablesEqual = oldStyle->variablesEqual(*newStyle);
|
| + if (!independentEqual || !nonIndependentEqual || !variablesEqual) {
|
| + // Check if only independent inherited properties changed.
|
| if (nonIndependentEqual && !oldStyle->hasExplicitlyInheritedProperties())
|
| - return IndependentInherit;
|
| + if (variablesEqual)
|
| + return IndependentInherit;
|
| + // Variables and possibly independent inherited properties changed.
|
| + return IndependentInheritWithVariables;
|
| return Inherit;
|
| }
|
|
|
| @@ -239,6 +244,16 @@ void ComputedStyle::propagateIndependentInheritedProperties(
|
| setPointerEvents(parentStyle.pointerEvents());
|
| if (m_nonInheritedData.m_isVisibilityInherited)
|
| setVisibility(parentStyle.visibility());
|
| +
|
| + // Variables.
|
| + if (parentStyle.variables() != variables()) {
|
| + for (const auto& variable : *parentStyle.variables()) {
|
| + if (inheritsVariableDefinitionFromParent(variable.key) &&
|
| + *variable.value != *variables()->getVariable(variable.key)) {
|
| + setVariable(variable.key, variable.value);
|
| + }
|
| + }
|
| + }
|
| }
|
|
|
| StyleSelfAlignmentData resolvedSelfAlignment(
|
| @@ -518,6 +533,10 @@ bool ComputedStyle::nonIndependentInheritedEqual(
|
| m_rareInheritedData == other.m_rareInheritedData;
|
| }
|
|
|
| +bool ComputedStyle::variablesEqual(const ComputedStyle& other) const {
|
| + return m_rareInheritedData->compareEqualVariables(*other.m_rareInheritedData);
|
| +}
|
| +
|
| bool ComputedStyle::loadingCustomFontsEqual(const ComputedStyle& other) const {
|
| return font().loadingCustomFonts() == other.font().loadingCustomFonts();
|
| }
|
|
|