mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:27:43 +00:00
LibWeb: Port CSS::MediaQuery to new Strings
This commit is contained in:
parent
a381ce9519
commit
a0b1eddc56
4 changed files with 7 additions and 10 deletions
|
@ -379,17 +379,15 @@ bool MediaQuery::evaluate(HTML::Window const& window)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-1/#serialize-a-media-query-list
|
||||
DeprecatedString serialize_a_media_query_list(NonnullRefPtrVector<MediaQuery> const& media_queries)
|
||||
ErrorOr<String> serialize_a_media_query_list(NonnullRefPtrVector<MediaQuery> const& media_queries)
|
||||
{
|
||||
// 1. If the media query list is empty, then return the empty string.
|
||||
if (media_queries.is_empty())
|
||||
return "";
|
||||
return String {};
|
||||
|
||||
// 2. Serialize each media query in the list of media queries, in the same order as they
|
||||
// appear in the media query list, and then serialize the list.
|
||||
StringBuilder builder;
|
||||
builder.join(", "sv, media_queries);
|
||||
return builder.to_deprecated_string();
|
||||
return String::join(", "sv, media_queries);
|
||||
}
|
||||
|
||||
bool is_media_feature_name(StringView name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue