summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-02-14 19:46:46 +0000
committerTim Flynn <trflynn89@pm.me>2023-02-15 12:48:26 -0500
commit316092d18547fd810e156e74efd8807f275a310c (patch)
tree4bb1c710a171b301ffd5942701ad27d1b3dd79f9 /Userland
parentdca19b764bfad0b4a403ae16191f632eb307a4f7 (diff)
downloadserenity-316092d18547fd810e156e74efd8807f275a310c.zip
LibWeb: Use StringView in CSS::PreferredColorScheme
This doesn't need to hold the string data.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/CSS/PreferredColorScheme.cpp4
-rw-r--r--Userland/Libraries/LibWeb/CSS/PreferredColorScheme.h5
2 files changed, 4 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.cpp b/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.cpp
index 573c7facd4..9efb8a64cb 100644
--- a/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.cpp
+++ b/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
+ * Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -8,7 +8,7 @@
namespace Web::CSS {
-PreferredColorScheme preferred_color_scheme_from_string(DeprecatedString const& value)
+PreferredColorScheme preferred_color_scheme_from_string(StringView value)
{
if (value.equals_ignoring_case("light"sv))
return PreferredColorScheme::Light;
diff --git a/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.h b/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.h
index adf5c6c470..08b134f999 100644
--- a/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.h
+++ b/Userland/Libraries/LibWeb/CSS/PreferredColorScheme.h
@@ -1,12 +1,11 @@
/*
- * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
+ * Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
-#include <AK/DeprecatedString.h>
#include <AK/StringView.h>
namespace Web::CSS {
@@ -17,7 +16,7 @@ enum class PreferredColorScheme {
Light,
};
-PreferredColorScheme preferred_color_scheme_from_string(DeprecatedString const&);
+PreferredColorScheme preferred_color_scheme_from_string(StringView);
StringView preferred_color_scheme_to_string(PreferredColorScheme);
}