LibWeb: Add ComputedProperties::set_property_without_modifying_flags

There are a few places in style computation where we want to update the
value of a property without modifying the inherited or important flags.

Previously we would look up these flags and pass them to the normal
`set_property` method but this is unnecessary and was easy to forget to
do.
This commit is contained in:
Callum Law 2025-10-27 01:18:52 +13:00 committed by Sam Atkins
parent 84762021b8
commit 823dd11b67
Notes: github-actions[bot] 2025-10-27 09:53:13 +00:00
3 changed files with 20 additions and 19 deletions

View file

@ -118,11 +118,18 @@ void ComputedProperties::set_property(PropertyID id, NonnullRefPtr<StyleValue co
{
VERIFY(id >= first_longhand_property_id && id <= last_longhand_property_id);
m_property_values[to_underlying(id) - to_underlying(first_longhand_property_id)] = move(value);
set_property_without_modifying_flags(id, move(value));
set_property_important(id, important);
set_property_inherited(id, inherited);
}
void ComputedProperties::set_property_without_modifying_flags(PropertyID id, NonnullRefPtr<StyleValue const> value)
{
VERIFY(id >= first_longhand_property_id && id <= last_longhand_property_id);
m_property_values[to_underlying(id) - to_underlying(first_longhand_property_id)] = move(value);
}
void ComputedProperties::revert_property(PropertyID id, ComputedProperties const& style_for_revert)
{
VERIFY(id >= first_longhand_property_id && id <= last_longhand_property_id);