mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:57:45 +00:00
LibWeb: Port named_item_value from DeprecatedFlyString
This commit is contained in:
parent
c7cd6f2bef
commit
b37aab1277
19 changed files with 33 additions and 36 deletions
|
@ -147,9 +147,9 @@ WebIDL::ExceptionOr<JS::Value> HTMLCollection::item_value(size_t index) const
|
|||
return const_cast<Element*>(element);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::Value> HTMLCollection::named_item_value(DeprecatedFlyString const& index) const
|
||||
WebIDL::ExceptionOr<JS::Value> HTMLCollection::named_item_value(FlyString const& index) const
|
||||
{
|
||||
auto* element = named_item(FlyString::from_deprecated_fly_string(index).release_value());
|
||||
auto* element = named_item(index);
|
||||
if (!element)
|
||||
return JS::js_undefined();
|
||||
return const_cast<Element*>(element);
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
JS::MarkedVector<Element*> collect_matching_elements() const;
|
||||
|
||||
virtual WebIDL::ExceptionOr<JS::Value> item_value(size_t index) const override;
|
||||
virtual WebIDL::ExceptionOr<JS::Value> named_item_value(DeprecatedFlyString const& name) const override;
|
||||
virtual WebIDL::ExceptionOr<JS::Value> named_item_value(FlyString const& name) const override;
|
||||
virtual Vector<DeprecatedString> supported_property_names() const override;
|
||||
virtual bool is_supported_property_index(u32) const override;
|
||||
|
||||
|
|
|
@ -327,7 +327,7 @@ WebIDL::ExceptionOr<JS::Value> NamedNodeMap::item_value(size_t index) const
|
|||
return node;
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::Value> NamedNodeMap::named_item_value(DeprecatedFlyString const& name) const
|
||||
WebIDL::ExceptionOr<JS::Value> NamedNodeMap::named_item_value(FlyString const& name) const
|
||||
{
|
||||
auto const* node = get_named_item(name);
|
||||
if (!node)
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
virtual bool is_supported_property_index(u32 index) const override;
|
||||
virtual Vector<DeprecatedString> supported_property_names() const override;
|
||||
virtual WebIDL::ExceptionOr<JS::Value> item_value(size_t index) const override;
|
||||
virtual WebIDL::ExceptionOr<JS::Value> named_item_value(DeprecatedFlyString const& name) const override;
|
||||
virtual WebIDL::ExceptionOr<JS::Value> named_item_value(FlyString const& name) const override;
|
||||
|
||||
size_t length() const { return m_attributes.size(); }
|
||||
bool is_empty() const { return m_attributes.is_empty(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue