| Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
|
| index 71bf96ea8ac9e1b5c93c32921f727cd7f4d19600..fe045d56778f9c568867a0c7c06691c26f9b6678 100644
|
| --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
|
| +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
|
| @@ -60,6 +60,7 @@
|
| #include "core/css/StyleRuleImport.h"
|
| #include "core/css/StyleSheetContents.h"
|
| #include "core/css/resolver/AnimatedStyleBuilder.h"
|
| +#include "core/css/resolver/CSSVariableResolver.h"
|
| #include "core/css/resolver/MatchResult.h"
|
| #include "core/css/resolver/MediaQueryResult.h"
|
| #include "core/css/resolver/ScopedStyleResolver.h"
|
| @@ -1178,6 +1179,11 @@ static inline bool isPropertyInWhitelist(PropertyWhitelistType propertyWhitelist
|
| template <CSSPropertyPriority priority>
|
| void StyleResolver::applyAllProperty(StyleResolverState& state, CSSValue* allValue, bool inheritedOnly, PropertyWhitelistType propertyWhitelistType)
|
| {
|
| + // The 'all' property doesn't apply to variables:
|
| + // https://drafts.csswg.org/css-variables/#defining-variables
|
| + if (priority == ResolveVariables)
|
| + return;
|
| +
|
| unsigned startCSSProperty = CSSPropertyPriorityData<priority>::first();
|
| unsigned endCSSProperty = CSSPropertyPriorityData<priority>::last();
|
|
|
| @@ -1317,6 +1323,14 @@ void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc
|
| applyInheritedOnly = true;
|
| }
|
|
|
| + // TODO(leviw): We need the proper bit for tracking whether we need to do this work.
|
| + if (RuntimeEnabledFeatures::cssVariablesEnabled()) {
|
| + applyMatchedProperties<ResolveVariables>(state, matchResult.authorRules(), false, applyInheritedOnly);
|
| + applyMatchedProperties<ResolveVariables>(state, matchResult.authorRules(), true, applyInheritedOnly);
|
| + // TODO(leviw): stop recalculating every time
|
| + CSSVariableResolver::resolveVariableDefinitions(state);
|
| + }
|
| +
|
| // Now we have all of the matched rules in the appropriate order. Walk the rules and apply
|
| // high-priority properties first, i.e., those properties that other properties depend on.
|
| // The order is (1) high-priority not important, (2) high-priority important, (3) normal not important
|
|
|