mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02: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:
Notes:
sideshowbarker
2024-07-16 22:11:09 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c0e0cb86e1 Pull-request: https://github.com/SerenityOS/serenity/pull/23602
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user