mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Don't store custom name on StyleProperty
This reduces time spent in `~StyleProperty()` from 2.18% to 0.67% on https://cloudflare.com.
This commit is contained in:
parent
eb21ea890c
commit
df23b42b37
Notes:
github-actions[bot]
2025-11-12 10:20:48 +00:00
Author: https://github.com/tcl3
Commit: df23b42b37
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6796
Reviewed-by: https://github.com/gmta ✅
6 changed files with 24 additions and 18 deletions
|
|
@ -150,8 +150,7 @@ String CSSStyleProperties::item(size_t index) const
|
|||
|
||||
if (index < custom_properties_count) {
|
||||
auto keys = m_custom_properties.keys();
|
||||
auto custom_property = m_custom_properties.get(keys[index]);
|
||||
return custom_property.ptr()->custom_name.to_string();
|
||||
return keys[index].to_string();
|
||||
}
|
||||
|
||||
return CSS::string_from_property_id(m_properties[index - custom_properties_count].property_id).to_string();
|
||||
|
|
@ -250,7 +249,6 @@ WebIDL::ExceptionOr<void> CSSStyleProperties::set_property_internal(PropertyName
|
|||
.important = !priority.is_empty() ? Important::Yes : Important::No,
|
||||
.property_id = property.id(),
|
||||
.value = component_value_list.release_nonnull(),
|
||||
.custom_name = property.name(),
|
||||
};
|
||||
m_custom_properties.set(property.name(), style_property);
|
||||
updated = true;
|
||||
|
|
@ -415,8 +413,7 @@ WebIDL::ExceptionOr<void> CSSStyleProperties::set_property_style_value(PropertyN
|
|||
StyleProperty {
|
||||
Important::No,
|
||||
PropertyID::Custom,
|
||||
style_value,
|
||||
property.name() });
|
||||
style_value });
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
@ -534,7 +531,6 @@ Optional<StyleProperty> CSSStyleProperties::get_direct_property(PropertyNameAndI
|
|||
return StyleProperty {
|
||||
.property_id = property_id,
|
||||
.value = maybe_value.release_nonnull(),
|
||||
.custom_name = property_name_and_id.name(),
|
||||
};
|
||||
}
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue