mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb: Add MediaList wrapper
Most of the pieces were already there, I'd just forgotten to actually wire them up.
This commit is contained in:
committed by
Andreas Kling
parent
b8c0ebccfd
commit
bc4c185aef
@@ -29,10 +29,15 @@ void MediaList::set_media_text(String const& text)
|
||||
m_media = parse_media_query_list({}, text);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-1/#dom-medialist-item
|
||||
Optional<String> MediaList::item(size_t index) const
|
||||
bool MediaList::is_supported_property_index(u32 index) const
|
||||
{
|
||||
if (index >= length())
|
||||
return index < length();
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-1/#dom-medialist-item
|
||||
String MediaList::item(u32 index) const
|
||||
{
|
||||
if (!is_supported_property_index(index))
|
||||
return {};
|
||||
|
||||
return m_media[index].to_string();
|
||||
|
||||
Reference in New Issue
Block a user