mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Port CSS::MediaQuery to new Strings
This commit is contained in:
parent
a381ce9519
commit
a0b1eddc56
Notes:
sideshowbarker
2024-07-17 05:05:51 +09:00
Author: https://github.com/AtkinsSJ
Commit: a0b1eddc56
Pull-request: https://github.com/SerenityOS/serenity/pull/17478
Reviewed-by: https://github.com/trflynn89 ✅
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