diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index 5aa4e434a06..cedf8028be0 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -2335,9 +2335,9 @@ GC::Ref StyleComputer::compute_style(DOM::AbstractElement ab return *compute_style_impl(abstract_element, ComputeStyleMode::Normal, did_change_custom_properties); } -GC::Ptr StyleComputer::compute_pseudo_element_style_if_needed(DOM::Element& element, Optional pseudo_element, Optional did_change_custom_properties) const +GC::Ptr StyleComputer::compute_pseudo_element_style_if_needed(DOM::AbstractElement abstract_element, Optional did_change_custom_properties) const { - return compute_style_impl({ element, move(pseudo_element) }, ComputeStyleMode::CreatePseudoElementStyleIfNeeded, did_change_custom_properties); + return compute_style_impl(abstract_element, ComputeStyleMode::CreatePseudoElementStyleIfNeeded, did_change_custom_properties); } GC::Ptr StyleComputer::compute_style_impl(DOM::AbstractElement abstract_element, ComputeStyleMode mode, Optional did_change_custom_properties) const diff --git a/Libraries/LibWeb/CSS/StyleComputer.h b/Libraries/LibWeb/CSS/StyleComputer.h index 6a06e03f3c8..4b221bfb627 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.h +++ b/Libraries/LibWeb/CSS/StyleComputer.h @@ -153,7 +153,7 @@ public: [[nodiscard]] GC::Ref create_document_style() const; [[nodiscard]] GC::Ref compute_style(DOM::AbstractElement, Optional did_change_custom_properties = {}) const; - [[nodiscard]] GC::Ptr compute_pseudo_element_style_if_needed(DOM::Element&, Optional, Optional did_change_custom_properties) const; + [[nodiscard]] GC::Ptr compute_pseudo_element_style_if_needed(DOM::AbstractElement, Optional did_change_custom_properties) const; [[nodiscard]] RuleCache const& get_pseudo_class_rule_cache(PseudoClass) const; diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 66c51484fe9..9d09bd91ed0 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -739,7 +739,7 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_style(bool& did_cha style_computer.push_ancestor(*this); auto pseudo_element_style = computed_properties(pseudo_element); - auto new_pseudo_element_style = style_computer.compute_pseudo_element_style_if_needed(*this, pseudo_element, did_change_custom_properties); + auto new_pseudo_element_style = style_computer.compute_pseudo_element_style_if_needed({ *this, pseudo_element }, did_change_custom_properties); // TODO: Can we be smarter about invalidation? if (pseudo_element_style && new_pseudo_element_style) {