From ee9db999619cb880dcff679668e1e8c9b343ca4d Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 5 Dec 2024 11:08:58 +0000 Subject: [PATCH] LibWeb: Remove unused Realm arg from StyleComputer::get_inherit_value() We no longer need this now that property_initial_value() doesn't take a Realm. --- Libraries/LibWeb/Animations/KeyframeEffect.cpp | 2 +- Libraries/LibWeb/CSS/Interpolation.cpp | 2 +- Libraries/LibWeb/CSS/StyleComputer.cpp | 12 ++++++------ Libraries/LibWeb/CSS/StyleComputer.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Libraries/LibWeb/Animations/KeyframeEffect.cpp b/Libraries/LibWeb/Animations/KeyframeEffect.cpp index 9833ac36ab2..4c166406506 100644 --- a/Libraries/LibWeb/Animations/KeyframeEffect.cpp +++ b/Libraries/LibWeb/Animations/KeyframeEffect.cpp @@ -945,7 +945,7 @@ void KeyframeEffect::update_style_properties() for (auto i = to_underlying(CSS::first_property_id); i <= to_underlying(CSS::last_property_id); ++i) { if (element_style->is_property_inherited(static_cast(i))) { - auto new_value = CSS::StyleComputer::get_inherit_value(document.realm(), static_cast(i), &element); + auto new_value = CSS::StyleComputer::get_inherit_value(static_cast(i), &element); element_style->set_property(static_cast(i), *new_value, CSS::StyleProperties::Inherited::Yes); } } diff --git a/Libraries/LibWeb/CSS/Interpolation.cpp b/Libraries/LibWeb/CSS/Interpolation.cpp index 5bcd588165b..865f059365c 100644 --- a/Libraries/LibWeb/CSS/Interpolation.cpp +++ b/Libraries/LibWeb/CSS/Interpolation.cpp @@ -48,7 +48,7 @@ static NonnullRefPtr with_keyword_values_resolved(DOM::Elem case CSS::Keyword::Unset: return property_initial_value(property_id); case CSS::Keyword::Inherit: - return CSS::StyleComputer::get_inherit_value(element.realm(), property_id, &element); + return CSS::StyleComputer::get_inherit_value(property_id, &element); default: break; } diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index 0d4a183faba..7721f99ec64 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -928,7 +928,7 @@ void StyleComputer::set_all_properties(DOM::Element& element, Optional StyleComputer::get_inherit_value([[maybe_unused]] JS::Realm& initial_value_context_realm, CSS::PropertyID property_id, DOM::Element const* element, Optional pseudo_element) +NonnullRefPtr StyleComputer::get_inherit_value(CSS::PropertyID property_id, DOM::Element const* element, Optional pseudo_element) { auto* parent_element = element_to_inherit_style_from(element, pseudo_element); @@ -1688,7 +1688,7 @@ void StyleComputer::compute_defaulted_property_value(StyleProperties& style, DOM if (is_inherited_property(property_id)) { style.set_property( property_id, - get_inherit_value(document().realm(), property_id, element, pseudo_element), + get_inherit_value(property_id, element, pseudo_element), StyleProperties::Inherited::Yes, Important::No); } else { @@ -1703,7 +1703,7 @@ void StyleComputer::compute_defaulted_property_value(StyleProperties& style, DOM } if (value_slot->is_inherit()) { - value_slot = get_inherit_value(document().realm(), property_id, element, pseudo_element); + value_slot = get_inherit_value(property_id, element, pseudo_element); style.set_property_inherited(property_id, StyleProperties::Inherited::Yes); return; } @@ -1713,7 +1713,7 @@ void StyleComputer::compute_defaulted_property_value(StyleProperties& style, DOM if (value_slot->is_unset()) { if (is_inherited_property(property_id)) { // then if it is an inherited property, this is treated as inherit, - value_slot = get_inherit_value(document().realm(), property_id, element, pseudo_element); + value_slot = get_inherit_value(property_id, element, pseudo_element); style.set_property_inherited(property_id, StyleProperties::Inherited::Yes); } else { // and if it is not, this is treated as initial. @@ -1737,7 +1737,7 @@ void StyleComputer::compute_defaulted_values(StyleProperties& style, DOM::Elemen // In the color property, the used value of currentcolor is the inherited value. auto const& color = style.property(CSS::PropertyID::Color); if (color.to_keyword() == Keyword::Currentcolor) { - auto const& inherited_value = get_inherit_value(document().realm(), CSS::PropertyID::Color, element, pseudo_element); + auto const& inherited_value = get_inherit_value(CSS::PropertyID::Color, element, pseudo_element); style.set_property(CSS::PropertyID::Color, inherited_value); } } diff --git a/Libraries/LibWeb/CSS/StyleComputer.h b/Libraries/LibWeb/CSS/StyleComputer.h index 42bc40b4e4a..079d231cf47 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.h +++ b/Libraries/LibWeb/CSS/StyleComputer.h @@ -127,7 +127,7 @@ public: }; static void for_each_property_expanding_shorthands(PropertyID, CSSStyleValue const&, AllowUnresolved, Function const& set_longhand_property); static void set_property_expanding_shorthands(StyleProperties&, PropertyID, CSSStyleValue const&, CSS::CSSStyleDeclaration const*, StyleProperties const& style_for_revert, StyleProperties const& style_for_revert_layer, Important = Important::No); - static NonnullRefPtr get_inherit_value(JS::Realm& initial_value_context_realm, CSS::PropertyID, DOM::Element const*, Optional = {}); + static NonnullRefPtr get_inherit_value(CSS::PropertyID, DOM::Element const*, Optional = {}); static Optional user_agent_style_sheet_source(StringView name);