1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibWeb: Expose Parser::Function name as FlyString const&

This saves us from having to re-convert the StringView back to a
FlyString again when resolving UnresolvedStyleValues.
This commit is contained in:
Sam Atkins 2023-09-04 10:50:42 +01:00 committed by Andreas Kling
parent f527e55046
commit 733ad57f39
3 changed files with 5 additions and 6 deletions

View file

@ -150,7 +150,7 @@ RefPtr<StyleValue> Parser::parse_linear_gradient_function(ComponentValue const&
GradientRepeating repeating_gradient = GradientRepeating::No;
GradientType gradient_type { GradientType::Standard };
auto function_name = component_value.function().name();
auto function_name = component_value.function().name().bytes_as_string_view();
function_name = consume_if_starts_with(function_name, "-webkit-"sv, [&] {
gradient_type = GradientType::WebKit;
@ -275,7 +275,7 @@ RefPtr<StyleValue> Parser::parse_conic_gradient_function(ComponentValue const& c
GradientRepeating repeating_gradient = GradientRepeating::No;
auto function_name = component_value.function().name();
auto function_name = component_value.function().name().bytes_as_string_view();
function_name = consume_if_starts_with(function_name, "repeating-"sv, [&] {
repeating_gradient = GradientRepeating::Yes;
@ -378,7 +378,7 @@ RefPtr<StyleValue> Parser::parse_radial_gradient_function(ComponentValue const&
auto repeating_gradient = GradientRepeating::No;
auto function_name = component_value.function().name();
auto function_name = component_value.function().name().bytes_as_string_view();
function_name = consume_if_starts_with(function_name, "repeating-"sv, [&] {
repeating_gradient = GradientRepeating::Yes;