mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 19:47:17 +02:00
LibWeb: Avoid unnecessary String copy in parsing CSS custom properties
This commit is contained in:
committed by
Ali Mohammad Pur
parent
4fca9ee060
commit
3ede1d08f5
Notes:
sideshowbarker
2024-07-18 17:15:51 +09:00
Author: https://github.com/TobyAsE Commit: https://github.com/SerenityOS/serenity/commit/3ede1d08f5f Pull-request: https://github.com/SerenityOS/serenity/pull/7530 Reviewed-by: https://github.com/alimpfard
@@ -217,7 +217,7 @@ static bool takes_integer_value(CSS::PropertyID property_id)
|
||||
return property_id == CSS::PropertyID::ZIndex || property_id == CSS::PropertyID::FontWeight || property_id == CSS::PropertyID::Custom;
|
||||
}
|
||||
|
||||
static StringView parse_custom_property_name(StringView value)
|
||||
static StringView parse_custom_property_name(const StringView& value)
|
||||
{
|
||||
if (!value.starts_with("var(") && !value.ends_with(")"))
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user