mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
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.
This commit is contained in:
parent
2c3c821305
commit
ee9db99961
Notes:
github-actions[bot]
2024-12-05 19:00:48 +00:00
Author: https://github.com/AtkinsSJ
Commit: ee9db99961
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2783
4 changed files with 9 additions and 9 deletions
|
@ -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<CSS::PropertyID>(i))) {
|
||||
auto new_value = CSS::StyleComputer::get_inherit_value(document.realm(), static_cast<CSS::PropertyID>(i), &element);
|
||||
auto new_value = CSS::StyleComputer::get_inherit_value(static_cast<CSS::PropertyID>(i), &element);
|
||||
element_style->set_property(static_cast<CSS::PropertyID>(i), *new_value, CSS::StyleProperties::Inherited::Yes);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ static NonnullRefPtr<CSSStyleValue const> 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;
|
||||
}
|
||||
|
|
|
@ -928,7 +928,7 @@ void StyleComputer::set_all_properties(DOM::Element& element, Optional<CSS::Sele
|
|||
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);
|
||||
} else {
|
||||
|
@ -1670,7 +1670,7 @@ DOM::Element const* element_to_inherit_style_from(DOM::Element const* element, O
|
|||
return parent_element;
|
||||
}
|
||||
|
||||
NonnullRefPtr<CSSStyleValue const> StyleComputer::get_inherit_value([[maybe_unused]] JS::Realm& initial_value_context_realm, CSS::PropertyID property_id, DOM::Element const* element, Optional<CSS::Selector::PseudoElement::Type> pseudo_element)
|
||||
NonnullRefPtr<CSSStyleValue const> StyleComputer::get_inherit_value(CSS::PropertyID property_id, DOM::Element const* element, Optional<CSS::Selector::PseudoElement::Type> 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ public:
|
|||
};
|
||||
static void for_each_property_expanding_shorthands(PropertyID, CSSStyleValue const&, AllowUnresolved, Function<void(PropertyID, CSSStyleValue const&)> 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<CSSStyleValue const> get_inherit_value(JS::Realm& initial_value_context_realm, CSS::PropertyID, DOM::Element const*, Optional<CSS::Selector::PseudoElement::Type> = {});
|
||||
static NonnullRefPtr<CSSStyleValue const> get_inherit_value(CSS::PropertyID, DOM::Element const*, Optional<CSS::Selector::PseudoElement::Type> = {});
|
||||
|
||||
static Optional<String> user_agent_style_sheet_source(StringView name);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue