mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 09:18:55 +00:00
LibWeb/CSS: Take AbstractElement in resolve_unresolved_properties()
This commit is contained in:
parent
83aee2c7fc
commit
916e24de30
Notes:
github-actions[bot]
2025-09-11 16:49:07 +00:00
Author: https://github.com/AtkinsSJ
Commit: 916e24de30
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6118
3 changed files with 5 additions and 7 deletions
|
@ -59,14 +59,13 @@ void CascadedProperties::revert_layer_property(PropertyID property_id, Important
|
|||
m_properties.remove(it);
|
||||
}
|
||||
|
||||
void CascadedProperties::resolve_unresolved_properties(GC::Ref<DOM::Element> element, Optional<PseudoElement> pseudo_element)
|
||||
void CascadedProperties::resolve_unresolved_properties(DOM::AbstractElement abstract_element)
|
||||
{
|
||||
for (auto& [property_id, entries] : m_properties) {
|
||||
for (auto& entry : entries) {
|
||||
if (!entry.property.value->is_unresolved())
|
||||
continue;
|
||||
DOM::AbstractElement abstract_element { element, pseudo_element };
|
||||
entry.property.value = Parser::Parser::resolve_unresolved_style_value(Parser::ParsingParams { element->document() }, abstract_element, property_id, entry.property.value->as_unresolved());
|
||||
entry.property.value = Parser::Parser::resolve_unresolved_style_value(Parser::ParsingParams { abstract_element.document() }, abstract_element, property_id, entry.property.value->as_unresolved());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
void revert_property(PropertyID, Important, CascadeOrigin);
|
||||
void revert_layer_property(PropertyID, Important, Optional<FlyString> layer_name);
|
||||
|
||||
void resolve_unresolved_properties(GC::Ref<DOM::Element>, Optional<PseudoElement>);
|
||||
void resolve_unresolved_properties(DOM::AbstractElement);
|
||||
|
||||
private:
|
||||
CascadedProperties();
|
||||
|
|
|
@ -1567,9 +1567,8 @@ GC::Ref<CascadedProperties> StyleComputer::compute_cascaded_values(DOM::Element&
|
|||
}
|
||||
|
||||
// SVG presentation attributes are parsed as CSS values, so we need to handle potential custom properties here.
|
||||
if (element.is_svg_element()) {
|
||||
cascaded_properties->resolve_unresolved_properties(element, pseudo_element);
|
||||
}
|
||||
if (element.is_svg_element())
|
||||
cascaded_properties->resolve_unresolved_properties({ element, pseudo_element });
|
||||
}
|
||||
|
||||
// Normal author declarations, ordered by @layer, with un-@layer-ed rules last
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue