mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:57:35 +00:00
LibWeb: Port MediaList interface from DeprecatedString to String
This commit is contained in:
parent
72f54eca26
commit
ff45874d4e
4 changed files with 14 additions and 14 deletions
|
@ -31,13 +31,13 @@ void MediaList::initialize(JS::Realm& realm)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-1/#dom-medialist-mediatext
|
||||
DeprecatedString MediaList::media_text() const
|
||||
String MediaList::media_text() const
|
||||
{
|
||||
return serialize_a_media_query_list(m_media).to_deprecated_string();
|
||||
return serialize_a_media_query_list(m_media);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-1/#dom-medialist-mediatext
|
||||
void MediaList::set_media_text(DeprecatedString const& text)
|
||||
void MediaList::set_media_text(StringView text)
|
||||
{
|
||||
m_media.clear();
|
||||
if (text.is_empty())
|
||||
|
@ -51,16 +51,16 @@ bool MediaList::is_supported_property_index(u32 index) const
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-1/#dom-medialist-item
|
||||
DeprecatedString MediaList::item(u32 index) const
|
||||
Optional<String> MediaList::item(u32 index) const
|
||||
{
|
||||
if (!is_supported_property_index(index))
|
||||
return {};
|
||||
|
||||
return m_media[index]->to_string().to_deprecated_string();
|
||||
return m_media[index]->to_string();
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-1/#dom-medialist-appendmedium
|
||||
void MediaList::append_medium(DeprecatedString medium)
|
||||
void MediaList::append_medium(StringView medium)
|
||||
{
|
||||
// 1. Let m be the result of parsing the given value.
|
||||
auto m = parse_media_query(Parser::ParsingContext { realm() }, medium);
|
||||
|
@ -81,7 +81,7 @@ void MediaList::append_medium(DeprecatedString medium)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-1/#dom-medialist-deletemedium
|
||||
void MediaList::delete_medium(DeprecatedString medium)
|
||||
void MediaList::delete_medium(StringView medium)
|
||||
{
|
||||
auto m = parse_media_query(Parser::ParsingContext { realm() }, medium);
|
||||
if (!m)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue