Index: Source/core/css/resolver/StyleResolver.cpp |
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp |
index 00a6932783cb37c7cff22d9e5a54b52d6e90fcb8..e576f050b4dfa8b0763434b79a12a235133bceab 100644 |
--- a/Source/core/css/resolver/StyleResolver.cpp |
+++ b/Source/core/css/resolver/StyleResolver.cpp |
@@ -59,6 +59,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" |
@@ -1299,6 +1300,13 @@ void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc |
applyInheritedOnly = true; |
} |
+ if (RuntimeEnabledFeatures::cssVariablesEnabled() && document().styleEngine().usesVariables()) { |
+ applyMatchedProperties<ResolveVariables>(state, matchResult, false, matchResult.beginAuthor(), matchResult.endAuthor(), applyInheritedOnly); |
+ applyMatchedProperties<ResolveVariables>(state, matchResult, true, matchResult.beginAuthor(), matchResult.endAuthor(), 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 |