mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +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:
committed by
Andreas Kling
parent
faebbbc281
commit
c288bfb404
@@ -46,15 +46,15 @@ void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) co
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value
|
||||
auto color = parse_legacy_color_value(value);
|
||||
if (color.has_value())
|
||||
style.set_property(CSS::PropertyID::BackgroundColor, CSS::ColorStyleValue::create(color.value()), nullptr);
|
||||
style.set_property(CSS::PropertyID::BackgroundColor, CSS::ColorStyleValue::create(color.value()));
|
||||
} else if (name.equals_ignoring_ascii_case("text"sv)) {
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#the-page:rules-for-parsing-a-legacy-colour-value-2
|
||||
auto color = parse_legacy_color_value(value);
|
||||
if (color.has_value())
|
||||
style.set_property(CSS::PropertyID::Color, CSS::ColorStyleValue::create(color.value()), nullptr);
|
||||
style.set_property(CSS::PropertyID::Color, CSS::ColorStyleValue::create(color.value()));
|
||||
} else if (name.equals_ignoring_ascii_case("background"sv)) {
|
||||
VERIFY(m_background_style_value);
|
||||
style.set_property(CSS::PropertyID::BackgroundImage, *m_background_style_value, nullptr);
|
||||
style.set_property(CSS::PropertyID::BackgroundImage, *m_background_style_value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user