mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
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:
parent
faebbbc281
commit
c288bfb404
Notes:
github-actions[bot]
2024-08-02 18:38:45 +00:00
Author: https://github.com/awesomekling
Commit: c288bfb404
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/935
7 changed files with 50 additions and 45 deletions
|
@ -47,9 +47,9 @@ bool StyleProperties::is_property_inherited(CSS::PropertyID property_id) const
|
|||
return m_property_values[to_underlying(property_id)].style && m_property_values[to_underlying(property_id)].inherited == Inherited::Yes;
|
||||
}
|
||||
|
||||
void StyleProperties::set_property(CSS::PropertyID id, NonnullRefPtr<StyleValue const> value, CSS::CSSStyleDeclaration const* source_declaration, Inherited inherited, Important important)
|
||||
void StyleProperties::set_property(CSS::PropertyID id, NonnullRefPtr<StyleValue const> value, Inherited inherited, Important important)
|
||||
{
|
||||
m_property_values[to_underlying(id)] = StyleAndSourceDeclaration { move(value), source_declaration, important, inherited };
|
||||
m_property_values[to_underlying(id)] = StyleValueAndMetadata { move(value), important, inherited };
|
||||
}
|
||||
|
||||
void StyleProperties::set_animated_property(CSS::PropertyID id, NonnullRefPtr<StyleValue const> value)
|
||||
|
@ -78,11 +78,6 @@ RefPtr<StyleValue const> StyleProperties::maybe_null_property(CSS::PropertyID pr
|
|||
return m_property_values[to_underlying(property_id)].style;
|
||||
}
|
||||
|
||||
CSS::CSSStyleDeclaration const* StyleProperties::property_source_declaration(CSS::PropertyID property_id) const
|
||||
{
|
||||
return m_property_values[to_underlying(property_id)].declaration;
|
||||
}
|
||||
|
||||
CSS::Size StyleProperties::size_value(CSS::PropertyID id) const
|
||||
{
|
||||
auto value = property(id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue