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

@ -461,13 +461,7 @@ void ConnectionFromClient::inspect_dom_node(u64 page_id, WebView::DOMNodePropert
auto& element = as<Web::DOM::Element>(*node);
node->document().set_inspected_node(node);
GC::Ptr<Web::CSS::ComputedProperties> properties;
if (pseudo_element.has_value()) {
if (auto pseudo_element_node = element.get_pseudo_element_node(*pseudo_element))
properties = element.pseudo_element_computed_properties(*pseudo_element);
} else {
properties = element.computed_properties();
}
auto properties = element.computed_properties(pseudo_element);
if (!properties) {
async_did_inspect_dom_node(page_id, { property_type, {} });