LibWeb/CSS: Specify behavior for OOB CSSStyleDeclaration::item()

Corresponds to 56ed462ccd

We already did the right thing.
This commit is contained in:
Sam Atkins 2025-08-07 12:10:06 +01:00 committed by Jelle Raaijmakers
commit 24f4356c3f
Notes: github-actions[bot] 2025-08-07 12:31:40 +00:00
2 changed files with 2 additions and 0 deletions

View file

@ -33,6 +33,7 @@ size_t CSSDescriptors::length() const
String CSSDescriptors::item(size_t index) const String CSSDescriptors::item(size_t index) const
{ {
// The item(index) method must return the property name of the CSS declaration at position index. // The item(index) method must return the property name of the CSS declaration at position index.
// If there is no indexth object in the collection, then the method must return the empty string.
if (index >= length()) if (index >= length())
return {}; return {};

View file

@ -137,6 +137,7 @@ size_t CSSStyleProperties::length() const
String CSSStyleProperties::item(size_t index) const String CSSStyleProperties::item(size_t index) const
{ {
// The item(index) method must return the property name of the CSS declaration at position index. // The item(index) method must return the property name of the CSS declaration at position index.
// If there is no indexth object in the collection, then the method must return the empty string.
// FIXME: Include custom properties. // FIXME: Include custom properties.
if (index >= length()) if (index >= length())