diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index ef7e501214..ac5ca7d1c3 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -439,7 +439,7 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope style.set_property(property_id, value); } -bool StyleComputer::expand_unresolved_values(DOM::Element& element, StringView property_name, HashMap>& dependencies, Vector const& source, Vector& dest, size_t source_start_index, HashMap const& custom_properties) const +bool StyleComputer::expand_unresolved_values(DOM::Element& element, StringView property_name, HashMap>& dependencies, Vector const& source, Vector& dest, size_t source_start_index, HashMap const& custom_properties) const { // FIXME: Do this better! // We build a copy of the tree of StyleComponentValueRules, with all var()s replaced with their contents. @@ -532,14 +532,14 @@ bool StyleComputer::expand_unresolved_values(DOM::Element& element, StringView p return true; } -RefPtr StyleComputer::resolve_unresolved_style_value(DOM::Element& element, PropertyID property_id, UnresolvedStyleValue const& unresolved, HashMap const& custom_properties) const +RefPtr StyleComputer::resolve_unresolved_style_value(DOM::Element& element, PropertyID property_id, UnresolvedStyleValue const& unresolved, HashMap const& custom_properties) const { // Unresolved always contains a var(), unless it is a custom property's value, in which case we shouldn't be trying // to produce a different StyleValue from it. VERIFY(unresolved.contains_var()); Vector expanded_values; - HashMap> dependencies; + HashMap> dependencies; if (!expand_unresolved_values(element, string_from_property_id(property_id), dependencies, unresolved.values(), expanded_values, 0, custom_properties)) return {}; @@ -549,7 +549,7 @@ RefPtr StyleComputer::resolve_unresolved_style_value(DOM::Element& e return {}; } -void StyleComputer::cascade_declarations(StyleProperties& style, DOM::Element& element, Vector const& matching_rules, CascadeOrigin cascade_origin, Important important, HashMap const& custom_properties) const +void StyleComputer::cascade_declarations(StyleProperties& style, DOM::Element& element, Vector const& matching_rules, CascadeOrigin cascade_origin, Important important, HashMap const& custom_properties) const { for (auto const& match : matching_rules) { for (auto const& property : verify_cast(match.rule->declaration()).properties()) { @@ -575,9 +575,9 @@ void StyleComputer::cascade_declarations(StyleProperties& style, DOM::Element& e } } -static HashMap cascade_custom_properties(DOM::Element& element, Vector const& matching_rules) +static HashMap cascade_custom_properties(DOM::Element& element, Vector const& matching_rules) { - HashMap custom_properties; + HashMap custom_properties; if (auto* parent_element = element.parent_element()) { for (auto const& it : parent_element->custom_properties()) diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.h b/Userland/Libraries/LibWeb/CSS/StyleComputer.h index dd05dc7582..11714844db 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.h +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.h @@ -78,8 +78,8 @@ private: void compute_defaulted_property_value(StyleProperties&, DOM::Element const*, CSS::PropertyID, Optional) const; - RefPtr resolve_unresolved_style_value(DOM::Element&, PropertyID, UnresolvedStyleValue const&, HashMap const&) const; - bool expand_unresolved_values(DOM::Element&, StringView property_name, HashMap>& dependencies, Vector const& source, Vector& dest, size_t source_start_index, HashMap const& custom_properties) const; + RefPtr resolve_unresolved_style_value(DOM::Element&, PropertyID, UnresolvedStyleValue const&, HashMap const&) const; + bool expand_unresolved_values(DOM::Element&, StringView property_name, HashMap>& dependencies, Vector const& source, Vector& dest, size_t source_start_index, HashMap const& custom_properties) const; template void for_each_stylesheet(CascadeOrigin, Callback) const; @@ -89,7 +89,7 @@ private: Vector author_rules; }; - void cascade_declarations(StyleProperties&, DOM::Element&, Vector const&, CascadeOrigin, Important important, HashMap const&) const; + void cascade_declarations(StyleProperties&, DOM::Element&, Vector const&, CascadeOrigin, Important important, HashMap const&) const; void build_rule_cache(); void build_rule_cache_if_needed() const; diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 78d4bd7ac9..e1bdb47ab6 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -118,8 +118,8 @@ public: m_custom_properties.set(move(custom_property_name), move(style_property)); } - HashMap const& custom_properties() const { return m_custom_properties; } - HashMap& custom_properties() { return m_custom_properties; } + HashMap const& custom_properties() const { return m_custom_properties; } + HashMap& custom_properties() { return m_custom_properties; } void queue_an_element_task(HTML::Task::Source, Function); @@ -149,7 +149,7 @@ private: RefPtr m_inline_style; RefPtr m_specified_css_values; - HashMap m_custom_properties; + HashMap m_custom_properties; RefPtr m_class_list; Vector m_classes;