LibWeb: Always store ComputedProperties, even if no invalidations

Before this change, we'd skip storing the new ComputedProperties in
Element::recompute_style() if there was no invalidation needed.

This caused us to lose the information about which properties are
inherited and/or important (which is also carried by ComputedProperties,
but doesn't affect invalidation).

Consequently, we'd then fail to recompute inherited styles, since that
mechanism depends on this data.

The fix is simply to always store the new ComputedProperties.
This commit is contained in:
Andreas Kling 2025-04-12 22:45:25 +02:00 committed by Andreas Kling
parent 9ba76ea25a
commit e068ff5a5d
Notes: github-actions[bot] 2025-04-12 22:44:44 +00:00
3 changed files with 66 additions and 2 deletions

View file

@ -539,8 +539,7 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_style()
auto old_display_is_none = m_computed_properties ? m_computed_properties->display().is_none() : true;
auto new_display_is_none = new_computed_properties->display().is_none();
if (!invalidation.is_none())
set_computed_properties(move(new_computed_properties));
set_computed_properties(move(new_computed_properties));
if (old_display_is_none != new_display_is_none) {
play_or_cancel_animations_after_display_property_change();