mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 07:39:16 +00:00
LibWeb: Return AbstractElement
from element_to_inherit_style_from
No functional changes.
This commit is contained in:
parent
8af99388a6
commit
a2c9ab9c9a
Notes:
github-actions[bot]
2025-08-22 07:50:15 +00:00
Author: https://github.com/Calme1709
Commit: a2c9ab9c9a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5951
Reviewed-by: https://github.com/gmta ✅
3 changed files with 11 additions and 5 deletions
|
@ -3119,9 +3119,10 @@ NonnullRefPtr<StyleValue const> StyleComputer::compute_value_of_custom_property(
|
|||
// Unset is the same as inherit for inherited properties, and by default all custom properties are inherited.
|
||||
// FIXME: Support non-inherited registered custom properties.
|
||||
if (value->is_inherit() || value->is_unset()) {
|
||||
if (!abstract_element.element_to_inherit_style_from())
|
||||
auto element_to_inherit_style_from = abstract_element.element_to_inherit_style_from();
|
||||
if (!element_to_inherit_style_from.has_value())
|
||||
return document.custom_property_initial_value(name);
|
||||
auto inherited_value = DOM::AbstractElement { const_cast<DOM::Element&>(*abstract_element.element_to_inherit_style_from()) }.get_custom_property(name);
|
||||
auto inherited_value = element_to_inherit_style_from->get_custom_property(name);
|
||||
if (!inherited_value)
|
||||
return document.custom_property_initial_value(name);
|
||||
return inherited_value.release_nonnull();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue