LibWeb: Allow to pass pseudo-element type in computed properties getter

...and setter. We had lots of places where we check if pseudo-element
type is specified and then use `pseudo_element_computed_properties()` or
`computed_properties()`. This change moves these checks from caller side
to the getter and setter.
This commit is contained in:
Aliaksandr Kalenik 2025-07-18 19:34:58 +02:00 committed by Andreas Kling
commit 2fc405f1b2
Notes: github-actions[bot] 2025-07-18 19:20:46 +00:00
7 changed files with 48 additions and 70 deletions

View file

@ -75,9 +75,7 @@ bool AbstractElement::is_before(AbstractElement const& other) const
GC::Ptr<CSS::ComputedProperties const> AbstractElement::computed_properties() const
{
if (m_pseudo_element.has_value())
return m_element->pseudo_element_computed_properties(*m_pseudo_element);
return m_element->computed_properties();
return m_element->computed_properties(m_pseudo_element);
}
HashMap<FlyString, CSS::StyleProperty> const& AbstractElement::custom_properties() const