mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
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:
parent
86dc3ce001
commit
2fc405f1b2
Notes:
github-actions[bot]
2025-07-18 19:20:46 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 2fc405f1b2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5510
7 changed files with 48 additions and 70 deletions
|
@ -518,19 +518,11 @@ RefPtr<CSSStyleValue const> CSSStyleProperties::style_value_for_computed_propert
|
|||
};
|
||||
|
||||
auto get_computed_value = [&element, pseudo_element](PropertyID property_id) -> auto const& {
|
||||
if (pseudo_element.has_value())
|
||||
return element.pseudo_element_computed_properties(pseudo_element.value())->property(property_id);
|
||||
return element.computed_properties()->property(property_id);
|
||||
return element.computed_properties(pseudo_element)->property(property_id);
|
||||
};
|
||||
|
||||
if (property_is_logical_alias(property_id)) {
|
||||
GC::Ptr<ComputedProperties> computed_properties;
|
||||
|
||||
if (pseudo_element.has_value())
|
||||
computed_properties = element.pseudo_element_computed_properties(pseudo_element.value());
|
||||
else
|
||||
computed_properties = element.computed_properties();
|
||||
|
||||
auto computed_properties = element.computed_properties(pseudo_element);
|
||||
return style_value_for_computed_property(
|
||||
layout_node,
|
||||
map_logical_alias_to_physical_property(property_id, LogicalAliasMappingContext { computed_properties->writing_mode(), computed_properties->direction() }));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue