From 24f4356c3f12ad11cf532c69b657926d40e3b0a2 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 7 Aug 2025 12:10:06 +0100 Subject: [PATCH] LibWeb/CSS: Specify behavior for OOB CSSStyleDeclaration::item() Corresponds to https://github.com/w3c/csswg-drafts/commit/56ed462ccd71c8441d5b4221b45a3701cbbc610e We already did the right thing. --- Libraries/LibWeb/CSS/CSSDescriptors.cpp | 1 + Libraries/LibWeb/CSS/CSSStyleProperties.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/Libraries/LibWeb/CSS/CSSDescriptors.cpp b/Libraries/LibWeb/CSS/CSSDescriptors.cpp index 42a6234d89e..3b965b94269 100644 --- a/Libraries/LibWeb/CSS/CSSDescriptors.cpp +++ b/Libraries/LibWeb/CSS/CSSDescriptors.cpp @@ -33,6 +33,7 @@ size_t CSSDescriptors::length() const String CSSDescriptors::item(size_t index) const { // 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()) return {}; diff --git a/Libraries/LibWeb/CSS/CSSStyleProperties.cpp b/Libraries/LibWeb/CSS/CSSStyleProperties.cpp index 4593c20664d..d8a9b36c030 100644 --- a/Libraries/LibWeb/CSS/CSSStyleProperties.cpp +++ b/Libraries/LibWeb/CSS/CSSStyleProperties.cpp @@ -137,6 +137,7 @@ size_t CSSStyleProperties::length() const String CSSStyleProperties::item(size_t index) const { // 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. if (index >= length())