diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/css/computed_style_css_value_mapping.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/css/computed_style_css_value_mapping.cc | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/chromium/third_party/blink/renderer/core/css/computed_style_css_value_mapping.cc b/chromium/third_party/blink/renderer/core/css/computed_style_css_value_mapping.cc index c18d609e682..73691c9e784 100644 --- a/chromium/third_party/blink/renderer/core/css/computed_style_css_value_mapping.cc +++ b/chromium/third_party/blink/renderer/core/css/computed_style_css_value_mapping.cc @@ -47,42 +47,11 @@ ComputedStyleCSSValueMapping::GetVariables(const ComputedStyle& style, const PropertyRegistry* registry) { HeapHashMap<AtomicString, Member<const CSSValue>> variables; - StyleInheritedVariables* inherited = style.InheritedVariables(); - - if (inherited) { - for (const auto& name : inherited->GetCustomPropertyNames()) { - const CSSValue* value = - ComputedStyleCSSValueMapping::Get(name, style, registry); - if (value) - variables.Set(name, value); - } - } - - StyleNonInheritedVariables* non_inherited = style.NonInheritedVariables(); - - if (non_inherited) { - for (const auto& name : non_inherited->GetCustomPropertyNames()) { - const CSSValue* value = - ComputedStyleCSSValueMapping::Get(name, style, registry); - if (value) - variables.Set(name, value); - } - } - - // Registered properties with initial values are not stored explicitly on - // each computed style. Their initialness is instead indicated by the - // absence of that property on the computed style. This means that registered - // properties with an implicit initial value will not appear in the result of - // Style[Non]InheritedVariables::GetCustomPropertyNames, so we need to - // iterate though all registrations and add the initial values, if necessary. - if (registry) { - for (const auto& entry : *registry) { - if (variables.Contains(entry.key)) - continue; - const CSSValue* initial = entry.value->Initial(); - if (initial) - variables.Set(entry.key, initial); - } + for (const AtomicString& name : style.GetVariableNames()) { + const CSSValue* value = + ComputedStyleCSSValueMapping::Get(name, style, registry); + if (value) + variables.Set(name, value); } return variables; |