mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Make CSS::string_from_property_id() return FlyString const&
This avoids costly conversions from StringView to FlyString in CSS parsing and variable expansion.
This commit is contained in:
parent
1cea4e6407
commit
c0e0cb86e1
Notes:
sideshowbarker
2024-07-16 22:11:09 +09:00
Author: https://github.com/awesomekling
Commit: c0e0cb86e1
Pull-request: https://github.com/SerenityOS/serenity/pull/23602
6 changed files with 21 additions and 17 deletions
|
@ -79,7 +79,7 @@ String ResolvedCSSStyleDeclaration::item(size_t index) const
|
|||
if (index > length())
|
||||
return {};
|
||||
auto property_id = static_cast<PropertyID>(index + to_underlying(first_longhand_property_id));
|
||||
return MUST(String::from_utf8(string_from_property_id(property_id)));
|
||||
return string_from_property_id(property_id).to_string();
|
||||
}
|
||||
|
||||
static NonnullRefPtr<StyleValue const> style_value_for_background_property(Layout::NodeWithStyle const& layout_node, Function<NonnullRefPtr<StyleValue const>(BackgroundLayerData const&)> callback, Function<NonnullRefPtr<StyleValue const>()> default_value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue