diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-02-17 12:13:49 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-19 00:51:16 +0100 |
commit | 33e9c4e1b2f4e678cef0e3d49b1754c1807ac2a3 (patch) | |
tree | 1ca7ead003f315b1572fd3bb24e48c37a7b2afac | |
parent | b5eb2ee478ee1e114c266292047a23d91bac952f (diff) | |
download | serenity-33e9c4e1b2f4e678cef0e3d49b1754c1807ac2a3.zip |
LibWeb: Port GeneralEnclosed to new Strings
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/GeneralEnclosed.h | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Supports.cpp | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/GeneralEnclosed.h b/Userland/Libraries/LibWeb/CSS/GeneralEnclosed.h index 559a673311..71e3c6eab1 100644 --- a/Userland/Libraries/LibWeb/CSS/GeneralEnclosed.h +++ b/Userland/Libraries/LibWeb/CSS/GeneralEnclosed.h @@ -6,7 +6,7 @@ #pragma once -#include <AK/DeprecatedString.h> +#include <AK/String.h> namespace Web::CSS { @@ -71,15 +71,15 @@ inline MatchResult evaluate_or(Collection& collection, Evaluate evaluate) // https://www.w3.org/TR/mediaqueries-4/#typedef-general-enclosed class GeneralEnclosed { public: - GeneralEnclosed(DeprecatedString serialized_contents) + GeneralEnclosed(String serialized_contents) : m_serialized_contents(move(serialized_contents)) { } MatchResult evaluate() const { return MatchResult::Unknown; } - StringView to_string() const { return m_serialized_contents.view(); } + String const& to_string() const { return m_serialized_contents; } private: - DeprecatedString m_serialized_contents; + String m_serialized_contents; }; } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 97b1ec2187..84ca9c5c7e 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -1427,13 +1427,13 @@ Optional<GeneralEnclosed> Parser::parse_general_enclosed(TokenStream<ComponentVa // `[ <function-token> <any-value>? ) ]` if (first_token.is_function()) { transaction.commit(); - return GeneralEnclosed { first_token.to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string() }; + return GeneralEnclosed { first_token.to_string().release_value_but_fixme_should_propagate_errors() }; } // `( <any-value>? )` if (first_token.is_block() && first_token.block().is_paren()) { transaction.commit(); - return GeneralEnclosed { first_token.to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string() }; + return GeneralEnclosed { first_token.to_string().release_value_but_fixme_should_propagate_errors() }; } return {}; diff --git a/Userland/Libraries/LibWeb/CSS/Supports.cpp b/Userland/Libraries/LibWeb/CSS/Supports.cpp index fff9c5d372..7a390f3156 100644 --- a/Userland/Libraries/LibWeb/CSS/Supports.cpp +++ b/Userland/Libraries/LibWeb/CSS/Supports.cpp @@ -93,7 +93,7 @@ ErrorOr<String> Supports::InParens::to_string() const return value.visit( [](NonnullOwnPtr<Condition> const& condition) -> ErrorOr<String> { return String::formatted("({})", TRY(condition->to_string())); }, [](Supports::Feature const& it) -> ErrorOr<String> { return it.to_string(); }, - [](GeneralEnclosed const& it) -> ErrorOr<String> { return String::from_utf8(it.to_string()); }); + [](GeneralEnclosed const& it) -> ErrorOr<String> { return it.to_string(); }); } ErrorOr<String> Supports::Condition::to_string() const |