LibWeb: Only remember source CSSStyleDeclaration for animation-name

We were saving to source declarations for *every* property, even though
we only ever looked it up for animation-name.

This patch gets rid of the per-property source pointer and we now keep
a single pointer to the animation-name source only.

This shrinks StyleProperties from 6512 bytes to 4368 bytes per instance.
This commit is contained in:
Andreas Kling 2024-08-02 11:58:56 +02:00 committed by Andreas Kling
commit c288bfb404
Notes: github-actions[bot] 2024-08-02 18:38:45 +00:00
7 changed files with 50 additions and 45 deletions

View file

@ -977,7 +977,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);
element_style->set_property(static_cast<CSS::PropertyID>(i), *new_value, nullptr, CSS::StyleProperties::Inherited::Yes);
element_style->set_property(static_cast<CSS::PropertyID>(i), *new_value, CSS::StyleProperties::Inherited::Yes);
}
}