mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Update DOMStringList to match PlatformObject changes
- is_supported_property_index() no longer needs to be overridden - item_value() now returns Optional
This commit is contained in:
parent
06484d0663
commit
2a55ab13ef
Notes:
github-actions[bot]
2024-07-29 10:17:56 +00:00
Author: https://github.com/AtkinsSJ
Commit: 2a55ab13ef
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/883
2 changed files with 3 additions and 11 deletions
|
@ -56,17 +56,10 @@ bool DOMStringList::contains(StringView string)
|
|||
return m_list.contains_slow(string);
|
||||
}
|
||||
|
||||
bool DOMStringList::is_supported_property_index(u32 index) const
|
||||
{
|
||||
// The DOMStringList interface supports indexed properties. The supported property indices are the indices of this's
|
||||
// associated list.
|
||||
return index < m_list.size();
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::Value> DOMStringList::item_value(size_t index) const
|
||||
Optional<JS::Value> DOMStringList::item_value(size_t index) const
|
||||
{
|
||||
if (index + 1 > m_list.size())
|
||||
return JS::js_undefined();
|
||||
return {};
|
||||
|
||||
return JS::PrimitiveString::create(vm(), m_list.at(index));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue